Re: faster way to find task

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

 



Hi all:

2011/7/12 loody <miloody@xxxxxxxxx>
Dear all:
Is there faster way to find a give name of task?
for example, I have a thread, named "test", is there faster way to get the task struct  by passing "test" to some kernel api?


--
Regards,
I found a way as below:
for_each_process(task) {
printk(“%s[%d]\n”, task->comm, task->pid);
}

But it is time-consuming to do so if I periodically want to know whether "test" exist or not.
is there better way to do so?


--
Regards,
_______________________________________________
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