Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I might be wrong (anybody wants to comment?) but such threads are handled the same way as processes - meaning that if your run e.g. htop (or ps, etc...) and you spawn a thread, you'll see it running with its own PID (different from the parent process).
H Show threads as if they were processes
-L Show threads, possibly with LWP and NLWP columns
-T Show threads, possibly with SPID column
m Show threads after processes
-m Show threads after processes
Also, practically everything you would ever want to know about a particular thread can be found in files under /proc/[PID]/task/[TID].
Thanks for your answer.
Indeed top gives me the threads but the TID is not part of the information. Instead, I get a different PID for each POSIX therad.
Is there a way to get the TID also?
The information related to the thread is very interesting. How to get either he TID or the thread name while execution. We ran the top and ps utilities as a child process to the main process running the threads and record he information.
Last edited by YehudaSinger; 04-06-2015 at 06:11 AM.
Thanks for your answer. here are my remarks:
1, The TID is not the thread ID which is obtained either during the creation or by the thread_self)_'
2. The TID is obtained by the system call gettid(). This function is not in the libc. Hence, we call it by the following sequence: syscall(SYS_gettid) ;