Shared pain

Steven Schveighoffer schveiguy at yahoo.com
Fri Nov 19 05:02:47 PST 2010


On Fri, 19 Nov 2010 01:49:30 -0500, Steve Teale  
<steve.teale at britseyeview.com> wrote:

>
>> As I said before, I don't know if the thread being created by the
>> windows service procedure is properly initializing the D modules of the
>> library/runtime.  Try as the first line of ServiceMain to initialize the
>> current thread:
>>
>> auto mythread = thread_attachThis();
>>
>> see http://www.digitalmars.com/d/2.0/phobos/core_thread.html
>>
>> -Steve
>
> Steve,
>
> I don't think it gets as far as ServiceMain. Anyway, I tried it there,
> and at the point just before the first WINAPI call, but it still crashes.
>
> I can fix it, by making my statically initialized RegExp objects  
> __gshared
> or immutable, but the latter involves inserting a slew of tedious casts
> into my XML parser, since RexExp calls are used all over the place.
>
> See my separate post for my thoughts on that.

OK, I'm out of ideas, sorry :(

It certainly looks like there is an issue with TLS.  I wouldn't suggest  
band-aiding things how you are doing, because some modules in  
phobos/druntime use TLS also.  It's reasonable to assume that if your uses  
of TLS are failing, those may fail as well.

-Steve


More information about the Digitalmars-d mailing list