Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This 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!


  Search this Thread
Old 01-21-2010, 03:02 PM   #1
LQ Newbie
Registered: Dec 2009
Posts: 2

Rep: Reputation: 0
How to get and modify thread_info for a given pid?

How do I get thread_info for a given pid? Is there a way to modify PC of thread A in thread B so once thread A is scheduled, it will jump to the new instruction?

Any help is appreciated! Thanks in advance!

Old 01-21-2010, 03:35 PM   #2
LQ Guru
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Yes, there are plenty of ways to get OS-level info about a thread or process. Reading "/proc" or learning "gdb" are two particularly good choices:

And yes, there are plenty of ways to control the behavior of a thread or process; either within the process, or from other processes on the system (or, of course, even from remote hosts).

But you want to go for the *highest* level of abstraction (e.g. set a shared variable, or create a new class instance). You *don't* want to muck around with low-level constructs like Program Counters or stack frames.

Old 01-21-2010, 04:01 PM   #3
LQ Newbie
Registered: Dec 2009
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks paulsm4,

I see we can get the thread_info or task_struct for current thread, but I did not find how to get these for a given pid. Could you point me the api that I can use?

Thanks again.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the more easier way to check the pid and kill the pid cmx08 Linux - General 5 09-09-2008 11:57 PM
reading pid from pid file in C language shifter Programming 1 05-14-2008 11:49 AM
usb bluetooth modify vid & pid scan73 Linux - Newbie 1 02-11-2008 11:35 PM
kill pid.... won't work with 'pid' variable given.. sachitha Programming 6 03-06-2006 08:48 PM
/var/run/[XXX].pid - Tcl pid code liguorir Linux - Software 1 05-20-2004 11:32 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:55 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration