[Barrelfish-users] thread_cond_wait() and disp_disable()

Simon Peter speter at inf.ethz.ch
Fri Jul 13 14:32:09 CEST 2012


> I have two threads running on a single core, namely the master core 0, and I thread_cond_wait() one of them; normally it should block while the other thread continues uninterrupted. However, everything stop.

That shouldn't happen. If you're sure that everything has stopped, while 
it shouldn't, then this is a bug in the threads system and we should 
investigate.

> I looked at the code and, if I'm not mistaken, the dispatcher is disabled for achieving atomicity in the wait but not enabled again, until the waiting thread is signaled. Is that correct? Does that mean that the thread model in Barrelfish is meant to support just one thread per core per domain?

No. The thread will block while the dispatcher is disabled to achieve 
atomicity in executing the block, as you correctly found out. However, 
the disaptcher will be enabled again for the next runnable thread.

> If my intuition is correct, is there an alternative to blocking a thread in a way that another thread can awake it, allowing other threads to work on that same dispatcher? Or should/can I have multiple dispatchers on the same core in the same domain?

Multiple dispatchers on the same core per domain are possible, but not 
needed in your case.

Simon



More information about the Barrelfish-users mailing list