Googles appar
Huvudmeny

Post a Comment On: cbloom rants

"02-16-09 - Low Level Threading Junk Part 2.5"

5 Comments -

1 – 5 of 5
Blogger castano said...

Note that the __declspec(thread) mechanism is not supported in explicitely loaded DLLs, which makes it rather useless:

http://msdn.microsoft.com/en-us/library/ms682594(VS.85).aspx

February 17, 2009 at 12:52 PM

Blogger castano said...

Ah, I see that's also discussed in Nynaeve's part 6 article.

Something that I think he doesn't mention is that it does not only fail with dynamically loaded libraries, but also with delay loaded libraries that are linked implicitly.

February 17, 2009 at 1:14 PM

Blogger cbloom said...

DLL shmee-LL

February 17, 2009 at 2:28 PM

Anonymous Anonymous said...

Unfortunately, we have to ship DLLs at RAD. It's really annoying to have to take the function-call hit to get a thread-local value inside the goddamned memory allocator... but we do.

February 18, 2009 at 1:16 AM

Blogger cbloom said...

Ah the hard life of library providers.

I'm starting to think that *all* variables should be thread local by default in the future. Or maybe that there should just be no more simple global variable syntax, like if you put

int i;

outside of a function, it would be a compile error. You would have to say :

shared_global int i = 0;

or

thread_local int i = 0;

Accidentally using globals on a thread is such a super common threading error.

February 18, 2009 at 9:10 AM

You can use some HTML tags, such as <b>, <i>, <a>

This blog does not allow anonymous comments.

Comment moderation has been enabled. All comments must be approved by the blog author.

You will be asked to sign in after submitting your comment.