|
From: Ashley P. <api...@co...> - 2007-12-06 12:57:25
|
On Wed, 2007-12-05 at 17:46 +0000, Patrick Smears wrote: > In fact the memory / performance overhead would be acceptable (at > least > for running under Valgrind) - the issue is more that the threads are > created and destroyed dynamically in a number of different processes. So > there has to be a way of allocating each thread a unique integer in the > range 1..N, and relinquishing it again later - which requires > synchronisation, and so might become a chicken-and-egg situation :). But > I'll give it some thought, as there might be a way to do the allocation > that's easier than the general problem... Having an outer pthread mutex in each process to marshal access to the shared memory lock should work, you'd only need to put an upper bound on the number of processes. Ashley, |