* about posix threads.
@ 2003-05-20 5:50 Lejanson C. Go
2003-05-20 8:37 ` nanakos
2003-05-20 16:12 ` Glynn Clements
0 siblings, 2 replies; 4+ messages in thread
From: Lejanson C. Go @ 2003-05-20 5:50 UTC (permalink / raw)
To: linux-c-programming
i made a pthread program and i am quite puzzled why my program
spawns 4 threads.. when i view it in linux console.
i used 'ps -ax | grep myprog' command to get the processes for
my application and to my surprise it spawns 4 threads.. when i
only expected 3.. one for main, one for event, and one for recvdata.
spawnXXXXXX functions create new threads..
i really need ur help. can anyone tell me why this occur?
thanks a lot...
lejanson
=============/* snipp */==================
int main(void)
{
................
................
................
if (spawnEventThrd())
{
fprintf(stderr, "spawning event thread error\n");
exit(0);
}
if (spawnRecvDataThread())
{
fprintf(stderr, "spawning response thread error\n");
exit(0);
}
................
................
................
return 0;
}
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: about posix threads.
2003-05-20 5:50 about posix threads Lejanson C. Go
@ 2003-05-20 8:37 ` nanakos
2003-05-20 16:12 ` Glynn Clements
1 sibling, 0 replies; 4+ messages in thread
From: nanakos @ 2003-05-20 8:37 UTC (permalink / raw)
To: Lejanson C. Go; +Cc: linux-c-programming
>
> i made a pthread program and i am quite puzzled why my program
> spawns 4 threads.. when i view it in linux console.
>
> i used 'ps -ax | grep myprog' command to get the processes for
> my application and to my surprise it spawns 4 threads.. when i
> only expected 3.. one for main, one for event, and one for recvdata.
>
> spawnXXXXXX functions create new threads..
>
> i really need ur help. can anyone tell me why this occur?
>
> thanks a lot...
>
>
> lejanson
>
Can you provide us with all the source code????
> -
> To unsubscribe from this list: send the line "unsubscribe
> linux-c-programming" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: about posix threads.
2003-05-20 5:50 about posix threads Lejanson C. Go
2003-05-20 8:37 ` nanakos
@ 2003-05-20 16:12 ` Glynn Clements
1 sibling, 0 replies; 4+ messages in thread
From: Glynn Clements @ 2003-05-20 16:12 UTC (permalink / raw)
To: Lejanson C. Go; +Cc: linux-c-programming
Lejanson C. Go wrote:
> i made a pthread program and i am quite puzzled why my program
> spawns 4 threads.. when i view it in linux console.
>
> i used 'ps -ax | grep myprog' command to get the processes for
> my application and to my surprise it spawns 4 threads.. when i
> only expected 3.. one for main, one for event, and one for recvdata.
>
> spawnXXXXXX functions create new threads..
>
> i really need ur help. can anyone tell me why this occur?
If you use "ps axf", you will note that the additional thread is the
parent of all threads other than the main thread. This is just
something that the pthread library does; it doesn't indicate a bug in
your program.
I don't recall the precise reasons why the pthread library does this,
but it's related to limitations in the kernel's support for threads.
--
Glynn Clements <glynn.clements@virgin.net>
^ permalink raw reply [flat|nested] 4+ messages in thread
* about Posix Threads
@ 2003-05-20 6:51 Lejanson C. Go
0 siblings, 0 replies; 4+ messages in thread
From: Lejanson C. Go @ 2003-05-20 6:51 UTC (permalink / raw)
To: linux-c-programming
hello everyone. i am new here. i just would like to ask some
questions regarding posix threads and i hope someone could help
me.
i made a pthread program and i am quite puzzled why my program
spawns 4 threads.. when i view it in linux console.
i used 'ps -ax | grep myprog' command to get the processes for
my application and to my surprise it spawns 4 threads.. when i
only expected 3.. one for main, one for event, and one for recvdata.
spawnXXXXXX functions create new threads..
i really need ur help. can anyone tell me why this occur?
thanks a lot...
lejanson
=============/* snipp */==================
int main(void)
{
................
................
................
if (spawnEventThrd())
{
fprintf(stderr, "spawning event thread error\n");
exit(0);
}
if (spawnRecvDataThread())
{
fprintf(stderr, "spawning response thread error\n");
exit(0);
}
................
................
................
return 0;
}
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-05-20 16:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-20 5:50 about posix threads Lejanson C. Go
2003-05-20 8:37 ` nanakos
2003-05-20 16:12 ` Glynn Clements
-- strict thread matches above, loose matches on Subject: below --
2003-05-20 6:51 about Posix Threads Lejanson C. Go
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).