Quantcast
Channel: multi thread in c question - Stack Overflow
Browsing all 5 articles
Browse latest View live

Answer by Chintan Parikh for multi thread in c question

The question you have asked is classical case of "bounded waiting", and there is known way of solving this via [Bakery Algorithm].1The basic idea here is that you maintain two counts, first is current...

View Article



Answer by JMarsch for multi thread in c question

It's up to the operating system. In Windows, there is no guaranteed order that any given thread will be awoken and granted the mutex.

View Article

Answer by JSBձոգչ for multi thread in c question

Generally threading libraries do not make any such guarantees, because most OS's don't make any such guarantee. The thread wrapper can't (usually) do any better than the native OS thread management...

View Article

Answer by Carl Norum for multi thread in c question

That sort of behaviour would have to be an implementation detail of your threading library (which you didn't mention). I would guess most threading libraries don't make any such a guarantee, though....

View Article

multi thread in c question

Does mutex guarantee to execute thread in order of arriving? that is, if, thread 2 and thread 3 arrive is waiting while thread 1 is in critical sectionwhat exactly happen after thread 1 exit critical...

View Article

Browsing all 5 articles
Browse latest View live




Latest Images