Events

From: Steve Grubb (ddata@gate.net)
Date: Fri Jun 23 2000 - 07:47:43 EST


Hello All,

Actually Gyorgy points out something that I've been looking for too. Events have two unique abilities that I haven't found a counterpart in pthreads. One is that you can timeout if an event hasn't occurred within the specified time period. (This isn't limited just to events, you can timeout acquiring mutexes, semaphores, or critical sections.) And secondly, you can wait for an array of events (or mutexes, semaphores, critical sections, you can even mix and match). You can setup a shopping list of things your task needs to complete and go to sleep. The OS wakes you up when you have them all. You don't need to mess with lock hiearchies or spin waiting for other resources. This also helps to avoid deadlock since the OS wakes you only when all the resources are ready. Admittedly, it may be possible to construct all this in userspace or through a library, but it is probably most efficient in the kernel since its job is the allocation of resources. It would have the big picture of who's waiting for what and their processes priority.

Cheers,
Steve Grubb

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Jun 23 2000 - 21:00:26 EST