Boost logo

Boost Users :

From: Mark Storer (mstorer_at_[hidden])
Date: 2002-11-05 13:30:47


I'd think you could get away with something like a set range, like 0 to
1000, and then map those values into whatever system is present. You could
even use floating point values, 0.0 to 1.0, though people might look at you
cross-eyed, at least until they got used to the idea. Then it's just a
matter of mapping those ranges to whatever OS settings are present.

You just state up front a couple caveats: Given two threads, A (higher
priority) and B (lower priority), you only guarentee that A won't be given a
lower underlying system priority than B. This would save you quite a bit of
grief... particularly when someone wants threads with priority 1.0, 0.99 and
0.98. The thread with 0.98 might not run slower than the one with a 1.0
priority, but it certainly won't be faster.

SOUNDS simple enough. At least to someone whose sum total multi-threading
experience is a toy java applet and a dozen lines of boost::thread code. ;)

--Mark Storer
  Software Engineer
  Cardiff Software

#include <disclaimer>
typedef std::disclaimer<Cardiff> Discard;


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net