linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 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
* 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).