Mail Archives: cygwin/2003/10/28/07:58:34
Arash Partow wrote:
> Greetings to Thomas and all others involved in cygwin pthreads
> implementation,
>
> I've downloaded the snapshots of cygwin1.dll (cygwin1-20031025.dll.bz2 and
> cygwin1-20031027.dll.bz2), I think the prior is the one where Thomas made
> changes and in the latter Corinna made changes to semaphores which I don't
> how that might effect pthreads. In both cases the stress test can run
> successfully under certain circumstances (which for normal application
> execution are not acceptable) in-one instance reaching 9million+ thread
> creations, however if one tries to do other things like edit a text file or
> play an mp3 or some other task, the Thread-Test will crash. In GDB the call
> stack shows the last call before the crash was to the cygwin1.dll, also
> sometimes if you try to restart the Thread-Test right after it has crashed,
> the new instance crashes almost immediately only ever getting up to about
> ~5000 thread creations.
Hi Arash,
this time i am not able to reproduce your problem.
Before i continue debugging i suggest that you check the return codes of
some pthread API functions first and call the pthread_functions only
with a valid thread id.
For example change
void Thread::start()
{
pthread_create(&threadID,NULL,&(Thread::threadFunction),this);
pthread_detach(threadID);
}
to
void Thread::start()
{
int res;
res = pthread_create(&threadID,NULL,&(Thread::threadFunction),this);
if (res)
setThreadState(THREAD_DEAD);
else
pthread_detach(threadID);
}
Please contact me if this still doesn't help.
Thomas
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -