public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Threads
@ 2000-02-04  6:32 M Dipperstein
  2000-02-04  8:06 ` Threads Mumit Khan
  0 siblings, 1 reply; 26+ messages in thread
From: M Dipperstein @ 2000-02-04  6:32 UTC (permalink / raw)
  To: cygwin

There have been several postings to the list which discuss pthreads and
the lack of "thread safety" in cygwin.  I was hoping somebody would
clarify the statement that cygwin is not thread safe.

I'm developing a thread package from the QuickThreads primitives.  The
final target is not cygwin, but it's a great tool for development along
the way.  So far, there seem to be no problems using the QuickThreads
primitives in code compiled with gcc under cygwin.

Are the only concerns regarding thread safety related to non-reentrant code
in the cygwin libraries?  If that's the only problem, I think I don't have
to worry.  The thread package I'll be working with is cooperative, and
will not allow for library routines to be reentered before they have
returned.

-Mike


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 26+ messages in thread
* Re: Threads
@ 2014-10-26 13:20 Angelo Graziosi
  2014-10-26 21:38 ` Threads Ken Brown
  0 siblings, 1 reply; 26+ messages in thread
From: Angelo Graziosi @ 2014-10-26 13:20 UTC (permalink / raw)
  To: cygwin

Ken Brown wrote:
> The people who have been reporting frequent crashes are aware of the fix. Now I just have to wait and hope I don't hear from them for a few days.

Just for the record...

Both with the snapshot and test releases, the issues in building Emacs I 
had after the migration from Xp+Cygwin32 to W7+Cygwin64 are gone. Now it 
seems I can build/bootstrap Emacs trunk always at the first attempt, 
before I had to try at least 10-15 times...

I hope that the Ken's "hunt" is over... :)


Many thanks to Ken (and _Mum_, obviously...),
    Angelo.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 26+ messages in thread
* Threads
@ 2014-10-20 13:04 Ken Brown
  2014-10-20 16:43 ` Threads Corinna Vinschen
  2014-10-23 11:31 ` Threads Jon TURNEY
  0 siblings, 2 replies; 26+ messages in thread
From: Ken Brown @ 2014-10-20 13:04 UTC (permalink / raw)
  To: cygwin

When trying to debug emacs in gdb, I see several threads, but it's not always 
clear who created those threads and what they're doing.  As an example, I 
attached gdb to an emacs-X11 process (running under X) shortly after starting 
it, and I obtained the backtrace appended at the end of this message.

I assume Thread 12 was created by gdb.  Thread 6 appears to be a timer thread 
and Thread 2 appears to be a signal thread; I assume both of these were created 
by the Cygwin DLL.  And Thread 1 is the main thread.  I don't have any idea 
where the other threads came from.  Presumably at least one of them was created 
by Glib.

The situation is similar with emacs-w32 and emacs-nox, but with fewer threads.

In general, is there a way I can understand where all the threads come from?  My 
reason for asking is that we're still getting emacs bug reports on 64-bit 
Cygwin, with random crashes or assertion violations that are "impossible" 
according to the gdb backtraces. [*]  So I'm wondering whether they're caused by 
interference from other threads.

Or is there some other plausible explanation for "impossible" crashes?  This 
can't just be a result of a gdb bug, because in at least one case the assertion 
can be shown to be valid by using printf instead of gdb.

Ken

[*] By "impossible" I mean that examination of the relevant variables in gdb 
shows that the assertions are in fact true.  Two ongoing examples are

    http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18438
    http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18769


=============thread apply all bt==============================

Thread 12 (Thread 6288.0x554):
#0  0x0000000077b50591 in ntdll!DbgBreakPoint ()
     at /c/Windows/SYSTEM32/ntdll.dll
#1  0x0000000077bf7f48 in ntdll!DbgUiRemoteBreakin ()
     at /c/Windows/SYSTEM32/ntdll.dll
#2  0x00000000779f59ed in KERNEL32!BaseThreadInitThunk ()
     at /c/Windows/system32/kernel32.dll
#3  0x0000000077b2c541 in ntdll!RtlUserThreadStart ()
     at /c/Windows/SYSTEM32/ntdll.dll
#4  0x0000000000000000 in  ()

Thread 11 (Thread 6288.0x2280):
#0  0x0000000077b52bba in ntdll!ZwWaitForWorkViaWorkerFactory ()
     at /c/Windows/SYSTEM32/ntdll.dll
#1  0x0000000077b1fe3b in ntdll!RtlValidateHeap ()
     at /c/Windows/SYSTEM32/ntdll.dll
#2  0x000000018004619b in _cygtls::call2(unsigned int (*)(void*, void*), void*, 
void*) (this=0x2000002, func=0x0, arg=0x5e82d0, buf=buf@entry=0x47bcd50)
     at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygtls.cc:100
#3  0x00000001800462f4 in _cygtls::call(unsigned int (*)(void*, void*), void*) 
(func=<optimized out>, arg=<optimized out>)
     at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygtls.cc:30
#4  0x00000000779f59ed in KERNEL32!BaseThreadInitThunk ()
     at /c/Windows/system32/kernel32.dll
#5  0x0000000077b2c541 in ntdll!RtlUserThreadStart ()
     at /c/Windows/SYSTEM32/ntdll.dll
#6  0x0000000000000000 in  ()

Thread 10 (Thread 6288.0x22c0):
#0  0x0000000077b52bba in ntdll!ZwWaitForWorkViaWorkerFactory ()
     at /c/Windows/SYSTEM32/ntdll.dll
#1  0x0000000077b1fe3b in ntdll!RtlValidateHeap ()
     at /c/Windows/SYSTEM32/ntdll.dll
#2  0x000000018004619b in _cygtls::call2(unsigned int (*)(void*, void*), void*, 
void*) (this=0x2000002, func=0x29000029, arg=0x5e82d0, buf=buf@entry=0x4bbcd50)
     at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygtls.cc:100
#3  0x00000001800462f4 in _cygtls::call(unsigned int (*)(void*, void*), void*) 
(func=<optimized out>, arg=<optimized out>)
     at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygtls.cc:30
#4  0x00000000779f59ed in KERNEL32!BaseThreadInitThunk ()
     at /c/Windows/system32/kernel32.dll
#5  0x0000000077b2c541 in ntdll!RtlUserThreadStart ()
     at /c/Windows/SYSTEM32/ntdll.dll
#6  0x0000000000000000 in  ()

Thread 9 (Thread 6288.0x1e98):
#0  0x0000000077b515fa in ntdll!ZwDelayExecution ()
     at /c/Windows/SYSTEM32/ntdll.dll
#1  0x000007fefda11203 in SleepEx () at /c/Windows/system32/KERNELBASE.dll
#2  0x000000018010d970 in thread_pipe(void*) (arg=0x600d2bfe0)
     at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/select.cc:690
#3  0x0000000180044fc5 in cygthread::callfunc(bool) (this=this@entry=0x1801d0500 
<threads+352>, issimplestub=issimplestub@entry=false)
     at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygthread.cc:51
#4  0x000000018004552a in cygthread::stub(void*) (arg=arg@entry=0x1801d0500 
<threads+352>) at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygthread.cc:93
#5  0x000000018004619b in _cygtls::call2(unsigned int (*)(void*, void*), void*, 
void*) (this=0x43bce00, func=
     0x1800454d0 <cygthread::stub(void*)>, arg=0x1801d0500 <threads+352>, 
buf=buf@entry=0x43bcd50) at 
/usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygtls.cc:100
#6  0x00000001800462f4 in _cygtls::call(unsigned int (*)(void*, void*), void*) 
(func=<optimized out>, arg=<optimized out>)
     at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygtls.cc:30
#7  0x00000000779f59ed in KERNEL32!BaseThreadInitThunk ()
     at /c/Windows/system32/kernel32.dll
#8  0x0000000077b2c541 in ntdll!RtlUserThreadStart ()
     at /c/Windows/SYSTEM32/ntdll.dll
#9  0x0000000000000000 in  ()

Thread 8 (Thread 6288.0x1ae4):
#0  0x0000000077b5186a in ntdll!ZwWaitForMultipleObjects ()
     at /c/Windows/SYSTEM32/ntdll.dll
#1  0x000007fefda11430 in KERNELBASE!GetCurrentProcess ()
     at /c/Windows/system32/KERNELBASE.dll
#2  0x0000000000000000 in  ()

Thread 7 (Thread 6288.0x1bac):
#0  0x0000000077b5134a in ntdll!ZwRemoveIoCompletion ()
     at /c/Windows/SYSTEM32/ntdll.dll
#1  0x000007fefd095941 in  () at /c/Windows/System32/mswsock.dll
#2  0x0000000000000000 in  ()

Thread 6 (Thread 6288.0xf40):
#0  0x0000000077b512fa in ntdll!ZwWaitForSingleObject ()
     at /c/Windows/SYSTEM32/ntdll.dll
#1  0x000007fefda110dc in WaitForSingleObjectEx ()
     at /c/Windows/system32/KERNELBASE.dll
#2  0x000000018013db94 in timer_thread(void*) (x=0x37ba9d8)
     at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/timer.cc:145
#3  0x0000000180044fc5 in cygthread::callfunc(bool) (this=this@entry=0x1801d0450 
<threads+176>, issimplestub=issimplestub@entry=false)
     at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygthread.cc:51
#4  0x000000018004552a in cygthread::stub(void*) (arg=arg@entry=0x1801d0450 
<threads+176>) at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygthread.cc:93
#5  0x000000018004619b in _cygtls::call2(unsigned int (*)(void*, void*), void*, 
void*) (this=0x37bce00, func=
     0x1800454d0 <cygthread::stub(void*)>, arg=0x1801d0450 <threads+176>, 
buf=buf@entry=0x37bcd50) at 
/usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygtls.cc:100
#6  0x00000001800462f4 in _cygtls::call(unsigned int (*)(void*, void*), void*) 
(func=<optimized out>, arg=<optimized out>)
     at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygtls.cc:30
#7  0x00000000779f59ed in KERNEL32!BaseThreadInitThunk ()
     at /c/Windows/system32/kernel32.dll
#8  0x0000000077b2c541 in ntdll!RtlUserThreadStart ()
     at /c/Windows/SYSTEM32/ntdll.dll
#9  0x0000000000000000 in  ()

Thread 5 (Thread 6288.0x1cc0):
#0  0x0000000077b515fa in ntdll!ZwDelayExecution ()
     at /c/Windows/SYSTEM32/ntdll.dll
#1  0x000007fefda11203 in SleepEx () at /c/Windows/system32/KERNELBASE.dll
#2  0x000000018010d970 in thread_pipe(void*) (arg=0x600045f20)
     at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/select.cc:690
#3  0x0000000180044fc5 in cygthread::callfunc(bool) (this=this@entry=0x1801d03f8 
<threads+88>, issimplestub=issimplestub@entry=false)
     at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygthread.cc:51
#4  0x000000018004552a in cygthread::stub(void*) (arg=arg@entry=0x1801d03f8 
<threads+88>) at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygthread.cc:93
#5  0x000000018004619b in _cygtls::call2(unsigned int (*)(void*, void*), void*, 
void*) (this=0x33bce00, func=
     0x1800454d0 <cygthread::stub(void*)>, arg=0x1801d03f8 <threads+88>, 
buf=buf@entry=0x33bcd50) at 
/usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygtls.cc:100
#6  0x00000001800462f4 in _cygtls::call(unsigned int (*)(void*, void*), void*) 
(func=<optimized out>, arg=<optimized out>)
     at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygtls.cc:30
#7  0x00000000779f59ed in KERNEL32!BaseThreadInitThunk ()
     at /c/Windows/system32/kernel32.dll
#8  0x0000000077b2c541 in ntdll!RtlUserThreadStart ()
     at /c/Windows/SYSTEM32/ntdll.dll
#9  0x0000000000000000 in  ()

Thread 4 (Thread 6288.0x620):
#0  0x0000000077b5186a in ntdll!ZwWaitForMultipleObjects ()
     at /c/Windows/SYSTEM32/ntdll.dll
#1  0x000007fefda11430 in KERNELBASE!GetCurrentProcess ()
     at /c/Windows/system32/KERNELBASE.dll
#2  0x0000000000000000 in  ()

Thread 3 (Thread 6288.0x50c):
#0  0x0000000077b5186a in ntdll!ZwWaitForMultipleObjects ()
     at /c/Windows/SYSTEM32/ntdll.dll
#1  0x0000000077b1b037 in ntdll!TpIsTimerSet () at /c/Windows/SYSTEM32/ntdll.dll
#2  0x00000000779f59ed in KERNEL32!BaseThreadInitThunk ()
     at /c/Windows/system32/kernel32.dll
#3  0x0000000077b2c541 in ntdll!RtlUserThreadStart ()
     at /c/Windows/SYSTEM32/ntdll.dll
#4  0x0000000000000000 in  ()

Thread 2 (Thread 6288.0x4ec):
#0  0x0000000077b5131a in ntdll!ZwReadFile () at /c/Windows/SYSTEM32/ntdll.dll
#1  0x000007fefda11a7a in ReadFile () at /c/Windows/system32/KERNELBASE.dll
#2  0x00000000779f0a19 in ReadFile () at /c/Windows/system32/kernel32.dll
#3  0x00000001801197c2 in wait_sig(void*) ()
     at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/sigproc.cc:1239
#4  0x0000000180044fc5 in cygthread::callfunc(bool) (this=this@entry=0x1801d03a0 
<threads>, issimplestub=issimplestub@entry=false)
     at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygthread.cc:51
#5  0x000000018004552a in cygthread::stub(void*) (arg=arg@entry=0x1801d03a0 
<threads>) at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygthread.cc:93
#6  0x000000018004619b in _cygtls::call2(unsigned int (*)(void*, void*), void*, 
void*) (this=0x23ace00, func=
     0x1800454d0 <cygthread::stub(void*)>, arg=0x1801d03a0 <threads>, 
buf=buf@entry=0x23acd50) at 
/usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygtls.cc:100
#7  0x00000001800462f4 in _cygtls::call(unsigned int (*)(void*, void*), void*) 
(func=<optimized out>, arg=<optimized out>)
     at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygtls.cc:30
#8  0x00000000779f59ed in KERNEL32!BaseThreadInitThunk ()
     at /c/Windows/system32/kernel32.dll
#9  0x0000000077b2c541 in ntdll!RtlUserThreadStart ()
     at /c/Windows/SYSTEM32/ntdll.dll
#10 0x0000000000000000 in  ()

Thread 1 (Thread 6288.0x2304):
#0  0x0000000077b5186a in ntdll!ZwWaitForMultipleObjects ()
     at /c/Windows/SYSTEM32/ntdll.dll
#1  0x000007fefda11430 in KERNELBASE!GetCurrentProcess ()
     at /c/Windows/system32/KERNELBASE.dll
#2  0x0000000000000001 in  ()
Continuing.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 26+ messages in thread
* Threads
@ 1997-03-19 10:28 Davind Maharaj
  0 siblings, 0 replies; 26+ messages in thread
From: Davind Maharaj @ 1997-03-19 10:28 UTC (permalink / raw)
  To: 'Gnu Win32'

[-- Attachment #1: Type: text/plain, Size: 524 bytes --]

Hi,

I recently downloaded the Gnu Win32 development tools and I was trying to use the Thread functions (ie CreateThread etc).  Does anyone know which libraries I need to link into my executables and which header files I need to include in my source?  I tried including Windows32/Functions.h which has a CreateThread() prototype but got a slew of compile errors.

Any help would be greatly appreciated...

Davind Maharaj
Software Consultant - MCI Telecommunications
Phone: (904) 731-2532
Pager: (800) SKY-PAGE PIN# 873-7843

[-- Attachment #2: bin00000.bin --]
[-- Type: application/vnd.ms-tnef, Size: 2023 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2014-10-28 13:47 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-02-04  6:32 Threads M Dipperstein
2000-02-04  8:06 ` Threads Mumit Khan
  -- strict thread matches above, loose matches on Subject: below --
2014-10-26 13:20 Threads Angelo Graziosi
2014-10-26 21:38 ` Threads Ken Brown
2014-10-27 10:21   ` Threads Corinna Vinschen
2014-10-20 13:04 Threads Ken Brown
2014-10-20 16:43 ` Threads Corinna Vinschen
2014-10-20 19:03   ` Threads Corinna Vinschen
2014-10-20 19:58     ` Threads Ken Brown
2014-10-21 11:17       ` Threads Corinna Vinschen
2014-10-21 12:27         ` Threads Ken Brown
2014-10-23 11:31 ` Threads Jon TURNEY
2014-10-23 12:04   ` Threads Ken Brown
2014-10-23 15:37     ` Threads Corinna Vinschen
2014-10-23 18:07       ` Threads Achim Gratz
2014-10-23 20:32       ` Threads Ken Brown
2014-10-24  1:07         ` Threads Ken Brown
2014-10-24  9:46           ` Threads Corinna Vinschen
2014-10-24 11:05       ` Threads Jon TURNEY
2014-10-24 12:54         ` Threads Corinna Vinschen
2014-10-24 13:52           ` Threads Corinna Vinschen
2014-10-26 11:58             ` Threads Ken Brown
2014-10-28 10:44             ` Threads Jon TURNEY
2014-10-28 11:40               ` Threads Corinna Vinschen
2014-10-28 13:47                 ` Threads Ken Brown
1997-03-19 10:28 Threads Davind Maharaj

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).