From: Ross Johnson <rpj@ise.canberra.edu.au>
To: Paul Redondo <paul@matchvision.com>
Cc: pthreads-win32@sourceware.cygnus.com
Subject: Re: pthreads comments and suggestions [was: Re: Handle leak ?]
Date: Mon, 24 Jul 2000 00:50:00 -0000 [thread overview]
Message-ID: <397BF525.9E8E5799@ise.canberra.edu.au> (raw)
In-Reply-To: <NDBBLGLOJKFALGLAHFKAOEOGDNAA.paul@matchvision.com>
Paul Redondo wrote:
>
> > I got this same reaction when I notified this list about the bug
> > before: nobody believed there was a bug. TRY IT.
>
> I do confirm. There IS a bug. I'm gonna try your fix (the null testing), and
> relaunch the whole test (creation of detached threads during 24 hours).
David Baggett is currently testing another patch, this time in
pthread_create().
The theory is that _beginthreadex() should start threads suspended
so that the HANDLE it returns can be assigned to thread-threadH
before the thread gets too far or ends (if it's a very short thread).
Seems obvious now, but ...
That is, the patch below:
thread->threadH = (HANDLE)
_beginthreadex (
(void *) NULL, /* No security info */
(unsigned) stackSize, /* default stack size */
(unsigned (PT_STDCALL *) (void *))
_pthread_threadStart,
parms,
(unsigned) CREATE_SUSPENDED,
(unsigned *) &(thread->thread));
if (thread->threadH != (HANDLE) 0 && run)
{
ResumeThread(thread->threadH);
}
--
+----------------------+---+
| Ross Johnson | | E-Mail: rpj@ise.canberra.edu.au
| Info Sciences and Eng|___|
| University of Canberra | FAX: +61 6 2015227
| PO Box 1 |
| Belconnen ACT 2616 | WWW: http://willow.canberra.edu.au/~rpj/
| AUSTRALIA |
+--------------------------+
prev parent reply other threads:[~2000-07-24 0:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-07-20 3:28 Handle leak ? Steve Croall
2000-07-20 16:56 ` David Baggett
2000-07-21 0:02 ` pthreads comments and suggestions [was: Re: Handle leak ?] Tristan Savatier
2000-07-21 14:09 ` David Baggett
2000-07-23 18:01 ` David Baggett
2000-07-24 0:37 ` Paul Redondo
2000-07-24 0:50 ` Ross Johnson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=397BF525.9E8E5799@ise.canberra.edu.au \
--to=rpj@ise.canberra.edu.au \
--cc=paul@matchvision.com \
--cc=pthreads-win32@sourceware.cygnus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).