Multiple program counters

Apr 26, 2008 4 Replies

Hi, Does a multi-threaded process have multiple program counters ?



Thx in advans, Karthik Balaguru


Surely there are books that you could learn this stuff out of in one consistent whole, instead of getting bits and pieces off of newsgroups?

If it's only running on one processor, there's only one 'real' program counter. But each thread will have a context saved by the operating system which will get saved away as the thread is exited and restored as it is entered, and an important part of that context will be the program counter value.

Tim Wescott Control systems and communications consulting http://www.wescottdesign.com Need to learn how to apply control theory in your embedded system? "Applied Control Theory for Embedded Systems" by Tim Wescott Elsevier/Newnes, http://www.wescottdesign.com/actfes/actfes.html

Of course.

-- [mail]: Chuck F (cbfalconer at maineline dot net) [page]: Try the download section.

** Posted from
formatting link
**

Hi, =46rom my understanding PCs are more about the processor then the real threads itself.As another poster has said,you just save the value of pc during context switch and in another context it would store different value. I wish to stand corrected incase I am wrong. Regards, s.subbarayan

karthikbalaguru schrieb:

On most machines you'll find only one PC, may be there are some exotic machine structures that use really seperate memory areas for sepearate pieces of code, but that doesn't really make sense. Can you think of any advantage it would bring? The task/process count would be dependent on the hardware resources (array of PCs), you would need a lot of other duplicate registers for each area.

- Udo

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required