apparent sleep

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies




[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux