* apparent sleep
@ 2015-03-23 12:31 Milton Krutt
2015-03-23 19:49 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Milton Krutt @ 2015-03-23 12:31 UTC (permalink / raw)
To: kernelnewbies
Hi.
Following LDD3, I am dealing with wait queues, on a 2.6.10.
My loop is like:
while(enough()){
prepare_to_wait(&queue_head, &queue_entry, TASK_INTERRUPTIBLE);
atomic_set(&flag, 0);
if (!atomic_read(&flag, 0))
schedule();
finish_wait(&queue_head, &queue_entry);
}
My intention is to wake up the process at each loop by issuing CTRL^D.
Here is what happens:
the first time the process yields the processor, it actually sleeps and
I have to give it a CTRL^D in order to put it again in running state;
unfortunately, in the following loops, although it calls the schedule()
function, it magically regains the processor putting hisself in a running
state (since it runs, I guess the state is a running one).
In a few words, the while loop has thousands of iterations, but CTRL^D is
needed only during the first one.
Thank you all
^ permalink raw reply [flat|nested] 2+ messages in thread
* apparent sleep
2015-03-23 12:31 apparent sleep Milton Krutt
@ 2015-03-23 19:49 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2015-03-23 19:49 UTC (permalink / raw)
To: kernelnewbies
On Mon, Mar 23, 2015 at 05:31:51AM -0700, Milton Krutt wrote:
> Hi.
>
> Following LDD3, I am dealing with wait queues, on a 2.6.10.
Please use a modern kernel, 2.6.10 is _very_ old and no one can do
anything about it, and those that could, have long forgotten what was in
it.
good luck,
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-03-23 19:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-23 12:31 apparent sleep Milton Krutt
2015-03-23 19:49 ` Greg KH
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.