This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] pthread_fork



On Fri, 16 Aug 2002, Robert Collins wrote:

> On Fri, 2002-08-16 at 04:27, Thomas Pfaff wrote:
> >
> > This patch will fix the pthread key related problems with fork (key value
> > is restored after fork) and some minor fork related fixes.
>
> Thomas, Some feedback on this. (I know, less than a week - wow!)
>
> Some general things:
> MTinterface::init_pthread is breaking encapsulation of pthread, please
> correct this.

Agreed. First it was used only in MTinterface but then i discovered that
it would make sense in pthread_self too if the thread has been created
outside the pthread scope.

>
> You have moved more class specific code in to MTinterface. This further
> breaks abstraction FWICS. Can you enlarge on your reasons for that?

Aside from init_pthread i do not see any code that breaks abstraction. You
have decided to handle the mutex and conds lists in MTinterface, i did the
same with keys. I do not think that handling key destructors requires its
own class and list if you have already a list with all keys.

>
> Finally it seems to me that the pthread_before_fork new call could
> (should) be called from pthread_atfork_prepare.

Sure.

>
> This is a rather big patch, covering several different things -
> refactoring list code, altering initialisation of pthread classes,
> handling fork better for pthreads, handling fork for pthead_key's. I'd
> really like to see it as as series of smaller patches to debate more
> specifcally.

I will try to break the patch into smaller ones. I am just looking where
to start.

Thomas



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]