Re: Ensuring allocation isn't thread-local?

2022-01-22 Thread Jaime via Digitalmars-d-learn
On Saturday, 22 January 2022 at 19:06:38 UTC, Adam D Ruppe wrote: No. Anything allocated with `new` is not thread local... and even if it was, you can send the pointer to other threads anyway. The only things in thread local storage are the direct values in the non-shared global variables.

Re: Ensuring allocation isn't thread-local?

2022-01-22 Thread Adam D Ruppe via Digitalmars-d-learn
On Saturday, 22 January 2022 at 18:55:30 UTC, Jaime wrote: A) Do I need to worry about data being / not being in thread-local storage? No. Anything allocated with `new` is not thread local... and even if it was, you can send the pointer to other threads anyway. The only things in thread

Ensuring allocation isn't thread-local?

2022-01-22 Thread Jaime via Digitalmars-d-learn
Howdy. How do I make sure data isn't allocated thread-local, if I also want to immediately use it in a thread-local way, because, for instance, I happen to already possess its intended mutex, which was allocated before it? Is this sufficient? Also, is it even something to worry about? ```d