Question

If you don't know what is futex and linuxthreads-0.9, please, don't reply.

Can I mix in one program futex-based mutex with mutex from linuxthreads-0.8 or -0.9 (which was used in all glibc <=2.2 and in all uClibc) ?

I need interprocess mutex (pshared one, PTHREAD_PROCESS_SHARED).

So, If threads are started and managed by linuxthreads pthread_manager, will it be confused by futex-based sleep and wake?

Can I use futex-based mutexes both for inter-process and inter-thread synchronization?

Was it helpful?

Solution

I don't see why you couldn't.

You will not be able to use pthreads, obviously. You will probably be using the pthread library with the old mutexes and you will need to have the futex code in some other library.

You obviously cannot lock a linuxthreads mutex and unlock it with a futex function, that would never work.

But if one thread is blocked in the kernel waiting on a futex, I do not see how it's any different than being blocked on a disk I/O operation, and linuxthreads handles that well enough.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top