multiple threads mutex, unlocking order
multiple threads mutex, unlocking order
- Subject: multiple threads mutex, unlocking order
- From: Matt Connolly <email@hidden>
- Date: Mon, 16 Jun 2008 16:09:39 +0100
- Domainkey-status: no signature
Do the IOLock lock and unlock routines have to be called from the same
thread?
If multiple threads are waiting on the IOLock, are they executed in
the order that they began waiting on the Lock?
I'm looking for a way for a kernel task to wait for a user space
process to respond to a message.
Kernel thread #1 goes:
1. enqueue data to user-space process
2. call lock on mutex (already locked, so blocks).
user-space process goes:
1. receive notification via data queue
2. notify kernel that we've processed the message - calling via
IOUserClient connection
Kernel thread #2
1. gets message from IOUserClient subclass,
2. calls IOLockUnlock on the mutex, to wake up thread #1.
Basically, I want to serialise things, so that if there are multiple
kernel threads sending to the user-space process, that they will have
their information processed, and be woken from their locks in the
correct order.
-Matt
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden