Single thread or not?

SINGLE_THREADED_BLOCK() {
       SINGLE_THREADED_BLOCK() {
       }
       Single thread or not?
}

What is the nature of your question? I fail to see what problem you are trying to overcome. Perhaps I don’t know enough about threading to understand the issue. But even a guy like me might be able to figure out your issue with more context to your question.

1 Like

I’d avoid doing that.

SINGLE_THREADED_BLOCK uses a stack-allocated SingleThreadedSection to disable os_thread_scheduling within the block. However it does not reference count, so if you nest them, thread scheduling will be enabled after the inner section exits.

The answer is not single threaded at the line of your question in your code.

2 Likes

Thanks very much!