Re: how kernel distinguish threads

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

 



On 07/09/2007 06:29 PM, Feng Xian wrote:
> Hi, I am working on a project about reducing page faults of multi-threaded
> programs. I am using latest Fedora core (Linux 2.6) and pthread library. In
> this project, each user-level  thread (created by pthread_create()
> function)
> needs to pass a value to the task structure in the kernel which corresponds
> to the thread. The first step is getting a unique id of the task structure
> of each thread. But what is this unique id?
> 
> I tried to use getpid() to get the process id of each thread and use it as
> unique id. But this didnt work out since all threads in a process share the
> same pid. I tried to use the thread_id returned by pthread_create()
> function
> but this id is meaningless to the kernel. Could anyone help me out on this?

Use gettid() ??

_______________________________________________
Fedora-kernel-list mailing list
Fedora-kernel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-kernel-list

[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [USB]     [Asterisk PBX]

  Powered by Linux