Re: Running an old threads app on a current system



In article <4ED1677D3C%news@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Darren Salt <news@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
I demand that Kenny McCormack may or may not have written...

[snip]
Now, I'm running the app on a new system, which is, I believe, running
"Posix threads", and have noticed that you no longer have multiple
processes running. I find this surprising; I had assumed you had to
recompile it in order to make it run with Posix threads. But, it seems to
"just work".

Presumably it's already linked against libpthread.

I guess you are saying that the new "Posix threads" version of
"libpthread" is designed to be drop in compatible with the old "Linux
threads" version of "libpthread", so it does "just work". I guess I
always assumed (without much basis it seems) that they would not be
"drop in" compatible with each other.

But what I find really strange is the output of "pstree", which is like
this:

myapp(2551)---{myapp}(2563)

2551 is the pid of myapp (the only one). There is no process 2563.
So, what's up with that?

Isn't there?
$ ls /proc/2551/task
$ ps -o pid,tid,tname,stat,time,cmd m 2551

Indeed. There it is. Thanks.

Now, can you explain why they do it that way? Am I getting the sense
that the new threads model isn't that much different from the old one?
I.e., that there's still a separate pid involved; it's just hidden a
little better.

.