public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* limitations of TLS using GCC's __thread keyword and Cygwin
@ 2012-09-04 12:58 Václav Zeman
  2012-09-04 14:40 ` Ryan Johnson
  0 siblings, 1 reply; 7+ messages in thread
From: Václav Zeman @ 2012-09-04 12:58 UTC (permalink / raw)
  To: cygwin

Hi.

I am am porting a library that can use the __thread keyword in its
internals to provide thread local storage. Now, with MSVC there is a
limitation on pre-Vista Windows (see [1]) that DLLs using
__declspec(thread) (MSVC equivalent of GCC's __thread) cannot be
loaded using LoadLibrary() because pre-Vista Windows allocate the TLS
declared that way only on process startup. Vista and later Windows do
not seem to have the limitation. Since Cygwin officially still
supports at least Windows XP, I want to provide a library that works
there as well.

Does Cygwin's GCC and its TLS emulation work around this problem? IOW,
are Cygwin DLLs using TLS declared using __thread keyword safe to be
loaded using LoadLibrary()/dlopen() or are they not safe to be loaded
that way?

[1] http://msdn.microsoft.com/en-us/library/2s9wt68x.aspx

-- 
VZ

--
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] 7+ messages in thread

end of thread, other threads:[~2012-09-05 14:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-04 12:58 limitations of TLS using GCC's __thread keyword and Cygwin Václav Zeman
2012-09-04 14:40 ` Ryan Johnson
2012-09-04 20:50   ` Václav Zeman
2012-09-04 21:51     ` Christopher Faylor
2012-09-05  9:09       ` Václav Zeman
2012-09-05 14:04         ` Ryan Johnson
2012-09-05 19:55           ` Václav Zeman

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