* [pthread] Memory leak using pthread (pthreadVC)
@ 2004-01-05 17:09 Patrick DUPUTZ
2004-01-05 21:29 ` Will Bryant
0 siblings, 1 reply; 2+ messages in thread
From: Patrick DUPUTZ @ 2004-01-05 17:09 UTC (permalink / raw)
To: pthreads-win32
Hi,
I'm a new user of Posix Thread for Win32 (using pthreadVC.dll) and I
have encountered a problem of memory leak in my program since I replaced
the Win32 thread calls by Posix ones. Here is my program in the main
lines, did I miss something?
// My thread
void * ClientThread ( void * )
{
// pthread_exit( NULL ); // Commented because that does not
compile under MS Visual C+ 6.0 (don't know why!)
return( NULL ); // no other solution to compile..
}
// My Main
void Main(.)
{
pthread_t tid;
while ( true )
{
pthread_create( &tid, NULL, ClientThread, &arg );
}
exit( 0 );
}
Kind Regards,
Xterminhate.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [pthread] Memory leak using pthread (pthreadVC)
2004-01-05 17:09 [pthread] Memory leak using pthread (pthreadVC) Patrick DUPUTZ
@ 2004-01-05 21:29 ` Will Bryant
0 siblings, 0 replies; 2+ messages in thread
From: Will Bryant @ 2004-01-05 21:29 UTC (permalink / raw)
To: pthreads-win32
Hi Patrick,
I suggest you have a read through the standard pthreads documentation. You
must either pthread_join your threads, or pthread_detach them.
Cheers,
Will
----- Original Message -----
From: "Patrick DUPUTZ" <patrick.duputz@wanadoo.fr>
To: <pthreads-win32@sources.redhat.com>
Sent: Tuesday, January 06, 2004 6:09 AM
Subject: [pthread] Memory leak using pthread (pthreadVC)
> Hi,
>
> I'm a new user of Posix Thread for Win32 (using pthreadVC.dll) and I
> have encountered a problem of memory leak in my program since I replaced
> the Win32 thread calls by Posix ones. Here is my program in the main
> lines, did I miss something?
>
> // My thread
> void * ClientThread ( void * )
> {
> // pthread_exit( NULL ); // Commented because that does not
> compile under MS Visual C+ 6.0 (don't know why!)
>
> return( NULL ); // no other solution to compile..
> }
>
> // My Main
> void Main(.)
> {
> pthread_t tid;
>
> while ( true )
> {
> pthread_create( &tid, NULL, ClientThread, &arg );
> }
> exit( 0 );
> }
>
>
> Kind Regards,
> Xterminhate.
>
>
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-01-05 21:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-05 17:09 [pthread] Memory leak using pthread (pthreadVC) Patrick DUPUTZ
2004-01-05 21:29 ` Will Bryant
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 read-only IMAP folder(s) and NNTP newsgroup(s).