I have a related question - it would be great if someone could help me. Let's 
say there are multiple system scope pthreads running on  an SMP  system. Is 
there a chance that if a pthread holding a spinlock is scheduled out (due to a 
scheduling decision etc.) then other pthreads will be starved. Is there 
anything the system provides to guard against pthread starvation.
   
  Thanks,
  Peter

Peter Holmes <[EMAIL PROTECTED]> wrote:
  I am not very sure about the spin lock behavior of pthreads.

Here is the man page description:
The pthread_spin_lock() function will acquire lock if it is not currently
owned by another thread. If the lock cannot be acquired immediately, it
will spin attempting to acquire the lock (it will not sleep) until it
becomes available.

For a single processor scenario.
Let's say a pthread owns the lock and is blocked and now another thread tries 
to acquire it. Will the second thread not block until the first thread releases 
the lock.


- Peter


---------------------------------
Now that's room service! Choose from over 150,000 hotels 
in 45,000 destinations on Yahoo! Travel to find your fit.
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


 
---------------------------------
Sucker-punch spam with award-winning protection.
 Try the free Yahoo! Mail Beta.
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to