[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: =?UTF-8?B?UmU6IEtTdHJpbmdIYW5kbGVyOiBzdGF0ZWxlc3MvcmVlbnRyYW50L3RocmVh?= =?UTF-8?B?ZC1zYWZlPw==?=
From: Thomas Lübking <thomas.luebking () gmail ! com>
Date: 2012-10-26 20:00:08
Message-ID: f2d2c5af-e7c7-44f0-8c4b-554188605f31 () gmail ! com
[Download RAW message or body]
On Freitag, 26. Oktober 2012 21:06:35 CEST, Frank Reininghaus wrote:
> Yes, I thought the same, but then I wasn't entirely sure if all these
> functions really are thread-safe. Some of them have const static variables,
> which might be initialised the first time the function is called AFAIK. I
> don't know if that's guaranteed to work if the functions can be called from
> multiple threads.
The great oracle of mountain view says: "depends".
First 3 results:
----------------
http://stackoverflow.com/questions/1962880/is-c-static-member-variable-initialization-thread-safe
http://eli.thegreenplace.net/2011/08/30/construction-of-function-static-variables-in-c-is-not-thread-safe/
http://blogs.msdn.com/b/oldnewthing/archive/2004/03/08/85901.aspx
Reads to me:
run functions with local statics once before starting threads (or move them to a \
global scope if reasonable)
Cheers,
Thomas
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic