[cpp-threads] Presenting threading to users
Nick Maclaren
nmm1 at cus.cam.ac.uk
Sun May 6 11:47:41 BST 2007
This is roughly how I see the presentation, using the broadest of
brushes. Herb may correct me, but I think that it's what he is
looking for, too.
Level 1 (90% of users): they should use library X, preprocessor Y,
development environment, all of which will present a high-level
interface to them and hide all of the detailed threading control.
Fortran OpenMP can be used in this mode, but C++ OpenMP can't; C++
could provide threaded classes, in theory, but that is for the
future. Anyway, all of this is outside the standard.
Level 2 (9% of users): they should use the locking and high-level
atomics in SIMPLE ways, and call in an expert as soon as they start
doing anything in the slightest bit complicated. Who will almost
always say "don't" :-)
Level 3 (1% of users): these are developing the tools mentioned in
level 1, need access to the low-level primitives, and may need to
be subtle. If they can't handle that, they are the wrong people
for the job.
I would categorise myself as a level 2.5 person - I know enough
about the low level to use it, but only with a decent reference
in front of me, a lot of paper and extended peace and quiet to
work it out. And even then, I will get it wrong a lot of the
time :-)
Because of the problems, the standard should make it clear when a
programmer is using a purely level 3 primitive, and provide a way
for an expert to check that in a user's program when the user
denies that he has done so! grep is fine for the latter; anyone
who uses the preprocessor to build names is already beyond hope.
Regards,
Nick Maclaren,
University of Cambridge Computing Service,
New Museums Site, Pembroke Street, Cambridge CB2 3QH, England.
Email: nmm1 at cam.ac.uk
Tel.: +44 1223 334761 Fax: +44 1223 334679
More information about the cpp-threads
mailing list