From: Valdis.Kletnieks@vt.edu (Valdis.Kletnieks at vt.edu) Date: Tue, 05 Mar 2013 01:02:51 -0500 Subject: pthread_lock In-Reply-To: Your message of "Tue, 05 Mar 2013 11:02:45 +0530." References: <20130305044402.GA3117@debian.localdomain> Message-ID: <21589.1362463371@turing-police.cc.vt.edu> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On Tue, 05 Mar 2013 11:02:45 +0530, Mandeep Sandhu said: > next schedule. I think the waiting threads (processes) will moved from > the wait queue to the run queue from where they will be scheduled to > run. For bonus points, read source code and/or comments and figure out what Linux does to prevent the 'thundering herd' problem (consider 100 threads all waiting on the same mutex - if you blindly wake all 100 up, you'll schedule them all, the first will find the mutex available and then re-take it, and then the next 99 will get run only to find it contended and go back to sleep. So figure out what Linux does in that case. :) -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 865 bytes Desc: not available Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130305/9bdeb5af/attachment.bin