Mutexes are the basic execution control mechanism in KGI.

The mutex API was originaly design on the basis of FreeBSD mutex(9) and condvar(9) implementations. On FreeBSD, mutexes and convars are different objects. In the KGI implementation, I decided to merge them. It is mutex centric e.g some events may be associated to a mutex. It's convenient when you have a mutex locking a object, the events associated to the mutex are obviously related to the object locked.

For example, when a buffer is finished to execute, you want to own the buffer mutex when returning from the waiting queue. That way you can proceed on the buffer immediatly after the wait. The downside is that you must own the mutex before waiting...

See the KgiMutexAPI for detailed info.

KgiMutex (last edited 2008-06-17 21:38:23 by localhost)