[gclist] Mars Rover info from comp.risks
Fabio Riccardi
Fabio.Riccardi@inria.fr
Wed, 7 Jan 1998 19:48:15 +0100
Hans Boehm writes:
> On Jan 7, 5:12pm, Fabio Riccardi wrote:
> > Condition variables are ment to share resources, so...
> >
> Could one of you clarify what this means? In non-realtime code, if I have a
> pthreads-like thread interface, pthread_cond_wait has no way of telling what
> thread it's waiting for. Indeed, if it's waiting for an instance of some
> instance to become available, it's waiting for whichever thread first releases
> such an instance.
priority inheritance, like other scheduling problems, has to be dealt
by the scheduler, definitively not something you want to do by hand.
As far as standards are concerned, the fact that pthreads is a broken
interface doesn't mean that the problem cannot be solved... you need a
slightly richer threading and locking semantics.
About who's waiting for what: to a lock is normally associated a list
of waiting tasks, so the scheduler can always go in there and check
the different process descriptors. You can also record which process
is currntly holding the lock.
Of course, all this is for some kind of real-time.
Fabio
--
Fabio Riccardi - INRIA, Project SOR |
email : Fabio.Riccardi@inria.fr | * time is on our side! *
http://www-sor.inria.fr/~riccardi/ |