[Gc] GC_thread_exit_proc error on win32_threads.c

Tommaso Tagliapietra (EXT VE SYS) tommaso.tagliapietra at enel.it
Wed Jun 7 04:41:42 PDT 2006


Another question on gc6.7: there is a reason why in win32_threads.c at the 
end of GC_start_routine there is a

    pthread_cleanup_pop(0);

and in pthread_support.c  there is a

    pthread_cleaunp_pop(1);

?



thank you for the other answers.

Tommy




----- Original Message ----- 
From: "Boehm, Hans" <hans.boehm at hp.com>
To: "Tommaso Tagliapietra (EXT VE SYS)" <tommaso.tagliapietra at enel.it>
Cc: <gc at napali.hpl.hp.com>
Sent: Tuesday, June 06, 2006 7:07 PM
Subject: RE: [Gc] GC_thread_exit_proc error on win32_threads.c


In that case, they should be created with just PTHREAD_CREATE_DETACHED.
I don't know what the impact of that would be without looking at the
pthreads implementation.  I would fix that and see if the problem goes
away.

Hans

> -----Original Message-----
> From: Tommaso Tagliapietra (EXT VE SYS)
> [mailto:tommaso.tagliapietra at enel.it]
> Sent: Tuesday, June 06, 2006 8:08 AM
> To: Boehm, Hans
> Cc: Boehm, Hans; gc at napali.hpl.hp.com
> Subject: Re: [Gc] GC_thread_exit_proc error on win32_threads.c
>
> However never of my threads are joined. Can be the attribute
> the problem?
>
> Tommy
>
>
> ----- Original Message -----
> From: "Hans Boehm" <Hans.Boehm at hp.com>
> To: "Tommaso Tagliapietra (EXT VE SYS)" <tommaso.tagliapietra at enel.it>
> Cc: "Boehm, Hans" <hans.boehm at hp.com>; <gc at napali.hpl.hp.com>
> Sent: Tuesday, June 06, 2006 4:57 PM
> Subject: Re: [Gc] GC_thread_exit_proc error on win32_threads.c
>
>
> >
> >
> > On Tue, 6 Jun 2006, Tommaso Tagliapietra (EXT VE SYS) wrote:
> >
> >> All threads are created with PTHREAD_CREATE_JOINABLE |
> >> PTHREAD_CREATE_DETACHED attribute and GC_pthread_create.
> At the end of
> >> the start_function of a thread I use a
> pthread_cleanup_push to call a
> >> function that change a flag in a struct, and than a
> >> pthread_cleanup_pop(1).
> > Don't do that.  PTHREAD_CREATE_JOINABLE means that the thread data
> > structure will persists after the thread finishes, and has to be
> > explicitly deallocated with pthread_join.  PTHREAD_CREATE_DETACHED
> > means it won't persists, and hence the thread can't be
> joined.  You can't
> > have it both ways.
> >
> > Hans
> >
>
>



More information about the Gc mailing list