<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On Thursday 30 October 2014 02:02 PM,
Rock Lee wrote:<br>
</div>
<blockquote
cite="mid:20141030083210.11B81838001@webmail.sinamail.sina.com.cn"
type="cite">
<p>Hi, everyone</p>
<p>I am implementing a simple driver to experiment with wait
queue.Two or more read processes block until a write process
changes a flag and call <span style="background-color: rgb(214,
212, 213);">wake_up_interruptible()</span>.I expect that a
write process will only wake up one read process.However, once a
write process calls <span style="background-color: rgb(214,
212, 213);">wake_up_interruptible()</span><span
style="background-color: rgb(255, 255, 255);"> , all the read
processes are awaken. </span>How can I wake up one process
from the wait queue?<br>
</p>
</blockquote>
You can use exclusive wait queues, which wakes up only one process
from the queue.<br>
<br>
Although the general idea that is followed is: all the process are
woken up once the resource is made available. And then the access to
that resource is guarded by a lock, which in turn allows only one
process to access the resource. Rest of the processes are pushed
backed to sleep(or busy wait).<br>
<br />-------------------------------------------------------------------------------------------------------------------------------
<br />[ C-DAC is on facebook. Kindly follow us on the following url: https://www.facebook.com/CDACINDIA ]
<br />
<br />This e-mail is for the sole use of the intended recipient(s) and may
<br />contain confidential and privileged information. If you are not the
<br />intended recipient, please contact the sender by reply e-mail and destroy
<br />all copies and the original message. Any unauthorized review, use,
<br />disclosure, dissemination, forwarding, printing or copying of this email
<br />is strictly prohibited and appropriate legal action will be taken.
<br />-------------------------------------------------------------------------------------------------------------------------------
</body>
<br />-------------------------------------------------------------------------------------------------------------------------------
<br />[ C-DAC is on Social-Media too. Kindly follow us at:
<br />Facebook: https://www.facebook.com/CDACINDIA & Twitter: @cdacindia ]
<br />
<br />This e-mail is for the sole use of the intended recipient(s) and may
<br />contain confidential and privileged information. If you are not the
<br />intended recipient, please contact the sender by reply e-mail and destroy
<br />all copies and the original message. Any unauthorized review, use,
<br />disclosure, dissemination, forwarding, printing or copying of this email
<br />is strictly prohibited and appropriate legal action will be taken.
<br />-------------------------------------------------------------------------------------------------------------------------------
</html>