From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23319 invoked by alias); 4 Sep 2012 20:50:48 -0000 Received: (qmail 23263 invoked by uid 22791); 4 Sep 2012 20:50:47 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_PGP_SIGNED,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-bk0-f43.google.com (HELO mail-bk0-f43.google.com) (209.85.214.43) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 04 Sep 2012 20:50:23 +0000 Received: by bkty15 with SMTP id y15so2872587bkt.2 for ; Tue, 04 Sep 2012 13:50:21 -0700 (PDT) Received: by 10.204.148.86 with SMTP id o22mr8874824bkv.59.1346791821755; Tue, 04 Sep 2012 13:50:21 -0700 (PDT) Received: from [10.0.0.1] (242.91.broadband5.iol.cz. [88.100.91.242]) by mx.google.com with ESMTPS id n17sm11396767bks.6.2012.09.04.13.50.18 (version=SSLv3 cipher=OTHER); Tue, 04 Sep 2012 13:50:19 -0700 (PDT) Message-ID: <50466981.70005@gmail.com> Date: Tue, 04 Sep 2012 20:50:00 -0000 From: =?UTF-8?B?VsOhY2xhdiBaZW1hbg==?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120827 Thunderbird/15.0 MIME-Version: 1.0 To: cygwin@cygwin.com Subject: Re: limitations of TLS using GCC's __thread keyword and Cygwin References: <504612A3.6070605@cs.utoronto.ca> In-Reply-To: <504612A3.6070605@cs.utoronto.ca> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig5280426DEE9547638B78FDDF" X-IsSubscribed: yes Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2012-09/txt/msg00054.txt.bz2 --------------enig5280426DEE9547638B78FDDF Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-length: 1328 On 09/04/2012 04:39 PM, Ryan Johnson wrote: > On 04/09/2012 8:58 AM, V=C3=A1clav Zeman wrote: >> 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 >> > I suspect it's not a problem, but if I were you I'd write a simple > test program to see. Unfortunately, TLS in general seems broken on my > machine when I tried it, but that might be due to my home-brew gcc > being configured wrong or something. I would have done that already but I do not have any Windows XP machine to try this on. --=20 VZ --------------enig5280426DEE9547638B78FDDF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" Content-length: 291 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iF4EAREIAAYFAlBGaYkACgkQ6OWUyaYNY6PeqwEAk/hOvLLEphVPsdM18elmPoVk Cqv8EI2bVSUgny7OxEoA/jEhYPOJo8oGYfBEGazBZzzgCP9CAwgOE7HgYLnOt/Z4 =jpQw -----END PGP SIGNATURE----- --------------enig5280426DEE9547638B78FDDF--