Re: Walking all task_struct.

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

 




Is the code

struct task_struct *p;
int count = 0;
read_lock(&tasklist_lock);
for_each_process(p) {
 if (p->my_pointer == some_address) count++;
}
read_unlock(&tasklist_lock);

can access all "task_struct"s at that moment?

In other words, is there a moment that
a valid task_struct with my_pointer == some_address
exists but not linked in the tasklist?


No.

Thanks,

Rajat

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[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