Thread (4 messages) 4 messages, 2 authors, 2011-07-11

faster way to find task

From: loody <hidden>
Date: 2011-07-11 16:34:00

Hi all:

2011/7/12 loody [off-list ref]
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,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110712/65ddaee1/attachment.html 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help