Thomas Stover | 1 Apr 03:14 2009

turning off thread local storage

I'm trying to figure out how to get a "regular" global variable that is 
shared by all threads. I'm not putting any __thread prefix or anything, 
yet I get two different memory addresses for a global variable in two 
different threads. This is terrible. Any ideas?

------------------------------------------------------------------------------
-- 
_______________________________________________
MinGW-users mailing list
MinGW-users@...

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.

Most annoying abuses are:
1) Top posting
2) Thread hijacking
3) HTML/MIME encoded mail
4) Improper quoting
5) Improper trimming
_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users

Thomas Stover | 1 Apr 03:32 2009

Re: turning off thread local storage

Thomas Stover wrote:
> I'm trying to figure out how to get a "regular" global variable that 
> is shared by all threads. I'm not putting any __thread prefix or 
> anything, yet I get two different memory addresses for a global 
> variable in two different threads. This is terrible. Any ideas?
>

More information: int, and void * work as expected. Function pointers, 
and pointers to structure seem to force tls. Oh well I guess I can type 
cast to work around, but there must be something I'm missing.

------------------------------------------------------------------------------
--

-- 
_______________________________________________
MinGW-users mailing list
MinGW-users@...

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.

Most annoying abuses are:
1) Top posting
2) Thread hijacking
3) HTML/MIME encoded mail
4) Improper quoting
5) Improper trimming
_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
(Continue reading)

Sylvester | 1 Apr 08:05 2009
Picon

NAN for integers?

Hi,
Can an integer be marked as NAN in mingw?

Thanks,
Sylvester

------------------------------------------------------------------------------
-- 
_______________________________________________
MinGW-users mailing list
MinGW-users@...

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.

Most annoying abuses are:
1) Top posting
2) Thread hijacking
3) HTML/MIME encoded mail
4) Improper quoting
5) Improper trimming
_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users

Xavier Miller | 1 Apr 09:16 2009

Re: NAN for integers?

Hello,

No, because all integers are valid.

If you need a NAN-like, you have to define one out of the "legal" range 
of your functionality. But this is quite error-prone.

Sylvester a écrit :
> Hi,
> Can an integer be marked as NAN in mingw?
> 
> Thanks,
> Sylvester
> 
> 
> ------------------------------------------------------------------------------

------------------------------------------------------------------------------
--

-- 
_______________________________________________
MinGW-users mailing list
MinGW-users@...

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.

Most annoying abuses are:
1) Top posting
2) Thread hijacking
(Continue reading)

Earnie Boyd | 1 Apr 13:58 2009
Picon
Picon

Re: turning off thread local storage

Quoting Thomas Stover <thomas@...>:

> Thomas Stover wrote:
>> I'm trying to figure out how to get a "regular" global variable that
>> is shared by all threads. I'm not putting any __thread prefix or
>> anything, yet I get two different memory addresses for a global
>> variable in two different threads. This is terrible. Any ideas?
>>
>
> More information: int, and void * work as expected. Function pointers,
> and pointers to structure seem to force tls. Oh well I guess I can type
> cast to work around, but there must be something I'm missing.
>

Sample code will help us help you.

--
Earnie

------------------------------------------------------------------------------
--

-- 
_______________________________________________
MinGW-users mailing list
MinGW-users@...

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.

Most annoying abuses are:
(Continue reading)

Keith Marshall | 1 Apr 17:41 2009
Picon
Picon

Re: Building RSL

[Please stop posting HTML multipart/alternative; plain text only is 
 what we prefer, thanks]

On Tuesday 31 March 2009 04:26:56 Jamie Lahowetz wrote:
> its looking for /bin/autoconf which is where it is. Thought that
> it maybe PATH:
> export PATH=".:/bin:/usr/local/bin:/mingw/bin:$PATH"

The default, set in /etc/profile, is

  export PATH=".:/usr/local/bin:/mingw/bin:/bin:$PATH"

You shouldn't need to change that.

> deadpickle <at> ITSONLYCHEESE /
> $ ls bin/
> a2p.exe        diff.exe     lnkcnv        rview
> aclocal        diff3.exe    ls.exe        rvim
> aclocal-1.10   dirname.exe  m4.exe        rxvt.exe
> aclocal-1.9    dprofpp      make.exe      s2p
> autoconf       echo         makeinfo.exe  sed.exe
> autoconf-2.13  egrep        md5sum.exe    sh.exe
>
> I know I'm going to feel stupid but, what am I missing?

Quite a lot, if that's all you have in your MSYS /bin; in fact, by 
*definition*, this couldn't possibly be an MSYS /bin, because it is 
missing msys-1.0.dll.

Here's what you should have, as a bare minimum, (after extraction of 
(Continue reading)

Keith Marshall | 1 Apr 11:19 2009
Picon
Picon

Re: NAN for integers?

On Wednesday 01 April 2009 07:05:22 Sylvester wrote:
> Can an integer be marked as NAN in mingw?

No; nor in any other system of which I know.  NAN is specifically a 
property of IEEE *floating point* numbers; all possible integer 
values represent valid numbers.

You can always reserve any value in the particular range of the data 
type of interest, to represent an invalid value, but that is your 
choice, and application specific.  If you adopt this technique, it 
is a good idea to define some manifest constants, to make your 
intention clear, e.g.:

  #include <limits.h>
   :
  #define MYAPP_INT_NAN     INT_MIN
  #define MYAPP_INT_MIN    (INT_MIN + 1)
  #define MYAPP_INT_MAX     INT_MAX

You also need to watch out for edge case calculations.  For example, 
with the above definitions:

  MYAPP_INT_MAX + 1

may wrap around, to become MYAPP_INT_NAN, on *some* platforms, but 
on others it may be clamped at MYAPP_INT_MAX; (it should wrap, with 
MinGW).  Similarly:

  MYAPP_INT_MAX + 2

(Continue reading)

Greg Chicares | 1 Apr 20:50 2009
Picon
Picon

Re: NAN for integers?

On 2009-04-01 09:19Z, Keith Marshall wrote:
> On Wednesday 01 April 2009 07:05:22 Sylvester wrote:
>> Can an integer be marked as NAN in mingw?
> 
> No; nor in any other system of which I know.  NAN is specifically a 
> property of IEEE *floating point* numbers; all possible integer 
> values represent valid numbers.
> 
> You can always reserve any value in the particular range of the data 
> type of interest, to represent an invalid value [...]

That approach is perfectly valid, yet I'd avoid it because it requires
considerable discipline on the part of the author and, more dangerously,
of any subsequent maintainer--as shown by the edge cases you point out.

One could use a wider type to hold the datum, and choose a special value
outside the logical type's range. Of course, that's what getc() does, to
handle EOF specially. But it'd be risky to assume that one particular
integer type is wider than another, so I'd consider using a floating-
point type--which would offer the advantage of a true hardware NaN,
though at the cost of either range (type float) or space (type double).

But that's just my speculative personal opinion, and choosing the best
solution would require more insight into the OP's needs. Your idea is
better than mine if the amount of storage is crucial.

------------------------------------------------------------------------------
--

-- 
_______________________________________________
MinGW-users mailing list
(Continue reading)

Keith Marshall | 1 Apr 22:31 2009
Picon
Picon

Re: NAN for integers?

On Wednesday 01 April 2009 19:50:05 Greg Chicares wrote:
> I'd consider using a floating-
> point type--which would offer the advantage of a true hardware NaN,
> though at the cost of either range (type float) or space (type
> double).
>
> But that's just my speculative personal opinion, and choosing the
> best solution would require more insight into the OP's needs. Your
> idea is better than mine if the amount of storage is crucial.

That would be an equally valid approach, which as you say has the 
advantage of a true NaN representation, but at the possible cost of 
lost precision -- floating point types may not be able to accurately 
represent the discrete values of the integer type emulated, leading 
to possible rounding error propagation in calculations.

Another possibility might be to create an aggregate data type, in 
which each integer value has an associated flags attribute.  That, of 
course will be more expensive on storage, and adds complexity, but as 
you say, it is all entirely speculative, without additional insight 
into the OP's actual requirements.

-- 

Regards,
Keith.

------------------------------------------------------------------------------
--

-- 
_______________________________________________
(Continue reading)

Jamie Lahowetz | 1 Apr 23:22 2009
Picon

Re: Building RSL

On Wed, Apr 1, 2009 at 10:41 AM, Keith Marshall
<keithmarshall@...> wrote:
>
> [Please stop posting HTML multipart/alternative; plain text only is
>  what we prefer, thanks]
>
> On Tuesday 31 March 2009 04:26:56 Jamie Lahowetz wrote:
> > its looking for /bin/autoconf which is where it is. Thought that
> > it maybe PATH:
> > export PATH=".:/bin:/usr/local/bin:/mingw/bin:$PATH"
>
> The default, set in /etc/profile, is
>
>  export PATH=".:/usr/local/bin:/mingw/bin:/bin:$PATH"
>
> You shouldn't need to change that.
>
> > deadpickle <at> ITSONLYCHEESE /
> > $ ls bin/
> > a2p.exe        diff.exe     lnkcnv        rview
> > aclocal        diff3.exe    ls.exe        rvim
> > aclocal-1.10   dirname.exe  m4.exe        rxvt.exe
> > aclocal-1.9    dprofpp      make.exe      s2p
> > autoconf       echo         makeinfo.exe  sed.exe
> > autoconf-2.13  egrep        md5sum.exe    sh.exe
> >
> > I know I'm going to feel stupid but, what am I missing?
>
> Quite a lot, if that's all you have in your MSYS /bin; in fact, by
> *definition*, this couldn't possibly be an MSYS /bin, because it is
(Continue reading)


Gmane