Re: [PATCH] minor pthread fixes

2002-06-05 Thread Christopher Faylor

On Wed, Jun 05, 2002 at 11:02:07AM -0400, Christopher Faylor wrote:
>If Thomas wants to send me, via private email, a scanned, signed copy of
>the assignment form that would be great, too.

I've gotten a copy of Thomas's assignment (it was a personal assignment so
I assume that he does not have an employer who could claim his work) so I'm
happy to let his patches in.

Thomas, please still send your paperwork via snail mail, too.  I apologize for
the inconvenience but at least we do send you a valuable prize (tm) for your
effort.  I think it's either a tee shirt or a coffee mug...

cgf



Re: [PATCH] minor pthread fixes

2002-06-05 Thread Christopher Faylor

On Wed, Jun 05, 2002 at 11:12:53PM +1000, Robert Collins wrote:
>
>
>> -Original Message-
>> From: [EMAIL PROTECTED] 
>> [mailto:[EMAIL PROTECTED]] On Behalf Of Corinna Vinschen
>> Sent: Wednesday, 5 June 2002 11:09 PM
>> To: [EMAIL PROTECTED]
>> Subject: Re: [PATCH] minor pthread fixes
>> 
>> 
>> On Wed, Jun 05, 2002 at 10:44:54PM +1000, Robert Collins wrote:
>> > Ok, Chris, whats the guideline in nuber-of-line before we need an
>> > assignment? Do I need to back out this patch (it's very few 
>> lines, just
>> > spread over a few functions).
>> 
>> I'm not Chris, sorry
>
>That's ok, you being a RedHat employee and all :}.
>
>> , but the answer is basically something below
>> 10 changed lines is treated as "nonsignificant".  There's no hard
>> rule, though.  Basically, if a change is not only fixing a bug but
>> introduces new functionality, it's a "significant" patch, even if
>> it's changing less than 10 lines.
>
>Hmm. I'll look carefully at the remaining patches to see if there is new
>functionality or just bugfixes. The current one should be fine though
>IMO.

It sounds like it is ok.  I trust your judgement, on this, Robert.

I'm willing to put the patch in the sources on a promise of an assignment
being forthcoming, too.  I just won't pull the sources into our internal
repository until I get the assignment.

If Thomas wants to send me, via private email, a scanned, signed copy of
the assignment form that would be great, too.

cgf



RE: [PATCH] minor pthread fixes

2002-06-05 Thread Robert Collins



> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED]] On Behalf Of Corinna Vinschen
> Sent: Wednesday, 5 June 2002 11:09 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PATCH] minor pthread fixes
> 
> 
> On Wed, Jun 05, 2002 at 10:44:54PM +1000, Robert Collins wrote:
> > Ok, Chris, whats the guideline in nuber-of-line before we need an
> > assignment? Do I need to back out this patch (it's very few 
> lines, just
> > spread over a few functions).
> 
> I'm not Chris, sorry

That's ok, you being a RedHat employee and all :}.

> , but the answer is basically something below
> 10 changed lines is treated as "nonsignificant".  There's no hard
> rule, though.  Basically, if a change is not only fixing a bug but
> introduces new functionality, it's a "significant" patch, even if
> it's changing less than 10 lines.

Hmm. I'll look carefully at the remaining patches to see if there is new
functionality or just bugfixes. The current one should be fine though
IMO.

Rob




Re: [PATCH] minor pthread fixes

2002-06-05 Thread Corinna Vinschen

On Wed, Jun 05, 2002 at 10:44:54PM +1000, Robert Collins wrote:
> Ok, Chris, whats the guideline in nuber-of-line before we need an
> assignment? Do I need to back out this patch (it's very few lines, just
> spread over a few functions).

I'm not Chris, sorry, but the answer is basically something below
10 changed lines is treated as "nonsignificant".  There's no hard
rule, though.  Basically, if a change is not only fixing a bug but
introduces new functionality, it's a "significant" patch, even if
it's changing less than 10 lines.

Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Developermailto:[EMAIL PROTECTED]
Red Hat, Inc.



RE: [PATCH] minor pthread fixes

2002-06-05 Thread Robert Collins

Ok, Chris, whats the guideline in nuber-of-line before we need an
assignment? Do I need to back out this patch (it's very few lines, just
spread over a few functions).

Likewise for the others in the queue. I can wait until Thomas's
assignment reaches you (which will delay 1.3.11) or I could review and
commit (perhaps if Thomas faxed a copy to you ahead of the letter
arriving?)

Rob

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED]] On Behalf Of Thomas Pfaff
> Sent: Wednesday, 5 June 2002 10:42 PM
> To: Robert Collins
> Cc: [EMAIL PROTECTED]
> Subject: RE: [PATCH] minor pthread fixes
> 
> 
> 
> Thank you.
> BTW i realized that Chris hasn't got an assignment from me yet.
> I will send one in the next days.
> 
> Regards,
> Thomas
> 
> On Wed, 5 Jun 2002, Robert Collins wrote:
> 
> > Thanks, applied.
> >
> > > -Original Message-
> > > From: Thomas Pfaff [mailto:[EMAIL PROTECTED]]
> > > Sent: Thursday, 18 April 2002 8:11 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: [PATCH] minor pthread fixes
> > >
> > >
> > >
> > > This patch contains some small pthread fixes:
> >
> > Rob
> >
> 
> 




RE: [PATCH] minor pthread fixes

2002-06-05 Thread Thomas Pfaff


Thank you.
BTW i realized that Chris hasn't got an assignment from me yet.
I will send one in the next days.

Regards,
Thomas

On Wed, 5 Jun 2002, Robert Collins wrote:

> Thanks, applied.
>
> > -Original Message-
> > From: Thomas Pfaff [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, 18 April 2002 8:11 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PATCH] minor pthread fixes
> >
> >
> >
> > This patch contains some small pthread fixes:
>
> Rob
>




RE: [PATCH] minor pthread fixes

2002-06-05 Thread Robert Collins

Thanks, applied.

> -Original Message-
> From: Thomas Pfaff [mailto:[EMAIL PROTECTED]] 
> Sent: Thursday, 18 April 2002 8:11 PM
> To: [EMAIL PROTECTED]
> Subject: [PATCH] minor pthread fixes
> 
> 
> 
> This patch contains some small pthread fixes:

Rob




RE: [PATCH] minor pthread fixes

2002-04-22 Thread Gerald S. Williams

I've held off on chiming in on this, mostly because I can
only speculate at this point (and partly because this is
probably the wrong list for this discussion). :-)

There is a race condition documented in the comments in the
condition variable code. I followed it through and at one
point was pretty convinced this is the root cause. I believe
this race condition should eventually be resolved, and would
like to help out (still working out the legal details). :-(
What I don't know yet is how much impact this would have on
Rob's code, thread performance, etc. The services you'd LIKE
to use aren't available to all Windows versions, so you may
have to add a thread or something similar.

Anyway, once the new thread code and Python are available, I
figured I'd at least try it out with threaded Python. Even a
seemingly-unrelated change might eliminate the failure if it
changes the timing. Simply undefing _POSIX_SEMAPHORES will
enable the old code, so it's easy to try.

-Jerry

-O Gerald S. Williams, 55A-134A-E   : mailto:[EMAIL PROTECTED] O-
-O AGERE SYSTEMS, 6755 SNOWDRIFT RD : office:610-712-8661  O-
-O ALLENTOWN, PA, USA 18106-9353: mobile:908-672-7592  O-

> -Original Message-
> From: Jason Tishler [mailto:[EMAIL PROTECTED]]
> Sent: Friday, April 19, 2002 7:49 AM
> To: Robert Collins
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PATCH] minor pthread fixes
> 
> 
> Rob,
> 
> On Fri, Apr 19, 2002 at 09:37:04PM +1000, Robert Collins wrote:
> > From memory - no. Alsothe symptoms are wrong - the test hangs, not
> > prematurely exiting. Anyway, it shouldn't be too hard to build a test
> > .dll and give it a try. If you want I can shoot such a  beast over to
> > you.
> 
> No, that's OK.  Thanks to Gerald Williams' related Python patch this
> issue has been obviated.  I was just trying to finally put this Cygwin
> pthreads problem to bed...
> 
> Jason
> 



Re: [PATCH] minor pthread fixes

2002-04-19 Thread Jason Tishler

Rob,

On Fri, Apr 19, 2002 at 09:37:04PM +1000, Robert Collins wrote:
> From memory - no. Alsothe symptoms are wrong - the test hangs, not
> prematurely exiting. Anyway, it shouldn't be too hard to build a test
> .dll and give it a try. If you want I can shoot such a  beast over to
> you.

No, that's OK.  Thanks to Gerald Williams' related Python patch this
issue has been obviated.  I was just trying to finally put this Cygwin
pthreads problem to bed...

Jason



RE: [PATCH] minor pthread fixes

2002-04-19 Thread Robert Collins



> -Original Message-
> From: Jason Tishler [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, April 19, 2002 9:38 PM
> To: Robert Collins
> Cc: Thomas Pfaff; [EMAIL PROTECTED]
> Subject: Re: [PATCH] minor pthread fixes
> 
> 
> Rob,
> 
> On Fri, Apr 19, 2002 at 08:31:52AM +1000, Robert Collins wrote:
> > > -Original Message-
> > > From: Jason Tishler [mailto:[EMAIL PROTECTED]]
> > > Sent: Thursday, April 18, 2002 9:58 PM
> > > 
> > > Could #2 have caused the problem that we saw with Python's
> > > test_threadedtempfile regression test?
> > 
> > I don't think so. python isn't creating and killing very 
> short lived 
> > threads is it?
> 
> Recall that test_threadedtempfile spawns many threads (IIRC, at least
> 26) -- maybe they are short lived?  See the following to refresh your

>From memory - no. Alsothe symptoms are wrong - the test hangs, not
prematurely exiting. Anyway, it shouldn't be too hard to build a test
.dll and give it a try. If you want I can shoot such a  beast over to
you.

Rob



Re: [PATCH] minor pthread fixes

2002-04-19 Thread Jason Tishler

Rob,

On Fri, Apr 19, 2002 at 08:31:52AM +1000, Robert Collins wrote:
> > -Original Message-
> > From: Jason Tishler [mailto:[EMAIL PROTECTED]] 
> > Sent: Thursday, April 18, 2002 9:58 PM
> > 
> > Could #2 have caused the problem that we saw with Python's 
> > test_threadedtempfile regression test?
> 
> I don't think so. python isn't creating and killing very short lived
> threads is it?

Recall that test_threadedtempfile spawns many threads (IIRC, at least
26) -- maybe they are short lived?  See the following to refresh your
memory:

http://www.cygwin.com/ml/cygwin-developers/2001-10/msg00193.html

Do you think that Tom's patch would fix this problem?

Thanks,
Jason



RE: [PATCH] minor pthread fixes

2002-04-18 Thread Robert Collins



> -Original Message-
> From: Jason Tishler [mailto:[EMAIL PROTECTED]] 
> Sent: Thursday, April 18, 2002 9:58 PM
> To: Robert Collins
> Cc: Thomas Pfaff; [EMAIL PROTECTED]
> Subject: Re: [PATCH] minor pthread fixes
> 
> 
> Rob,
> 
> On Thu, Apr 18, 2002 at 09:31:15PM +1000, Robert Collins wrote:
> > Regarding 2:, again  a good catch.
> 
> Could #2 have caused the problem that we saw with Python's 
> test_threadedtempfile regression test?

I don't think so. python isn't creating and killing very short lived
threads is it?

ROb



Re: [PATCH] minor pthread fixes

2002-04-18 Thread Jason Tishler

Rob,

On Thu, Apr 18, 2002 at 09:31:15PM +1000, Robert Collins wrote:
> Regarding 2:, again  a good catch. 

Could #2 have caused the problem that we saw with Python's
test_threadedtempfile regression test?

Thanks,
Jason



RE: [PATCH] minor pthread fixes

2002-04-18 Thread Robert Collins

Hi Thomas! It's great to see someone else also interested in pthreads. I
look forward to your work on cancellation - that's been in my TODO list
for far too long.

re: 1. Good catch, this definitely needs fixing. Also an excellent catch
on pthread_join (pthread_self(),...)

Regarding 2:, again  a good catch. 

I'll commit this to CVS this weekend, I've a bit of spare time coming
up.

Rob

> -Original Message-
> From: Thomas Pfaff [mailto:[EMAIL PROTECTED]] 
> Sent: Thursday, April 18, 2002 8:11 PM
> To: [EMAIL PROTECTED]
> Subject: [PATCH] minor pthread fixes
> 
> 
> 
> This patch contains some small pthread fixes:
> 
> 1. the pthread class allocated in __pthread_create never was 
> freed. This
>resulted in a memory leak and an unclosed handle.
>Depending on the state of of the thread it is deleted now in
>__pthread_exit or __pthread_join
> 2. The InterlockedIncrement (&MT_INTERFACE->threadcount) in
>__pthread_create is misplaced. If the newly created thread 
> terminates
>fast enough the threadcount will be decremented before it was
>incremented, which will result in an exit from 
> __pthread_exit instead
>of an ExitThread.
> 
> Comments are very welcome, because i like to add more patches 
> regarding cancellation which is incomplete, a better mutex 
> implementation (the current one has only recursive mutexes 
> and is slow on win9x) ... .
> 
> Thanks,
> Thomas
> 
> 
> 2002-04-18  Thomas Pfaff  <[EMAIL PROTECTED]>
> 
>   * thread.h (pthread::joiner): New member.
>   * thread.cc (pthread::pthread): Initialize joiner to NULL
>   (pthread::create): Increment of thread counter moved from
>   __pthread_create to this location.
>   (__pthread_create): Increment thread counter removed.
>   (thread_init_wrapper): Set joiner to self when thread 
> was created
>   detached.
>   (__pthread_exit): delete thread when it is detached and not
>   joined.
>   (__pthread_join): Check for deadlock and delete thread 
> when it has
>   terminated.
>   (__pthread_detach): Set joiner to self when thread state
>   changed to detached.
> 
>