-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Description
Hi,
I'm quite confused regarding CultureInfo, Parallesism, Scopes etc.
When a CultureInfo is set, it is set for a thread. For my understanding all Tasks that run in a Thread get the CultureInfo of the Thread they run in and when any of the Task changes the CultureInfo it is changing the CultureInfo of the whole Thread and therefore all of the Tasks. I have the assumption that scopes don't run in seperate threads and more in seperate tasks. Is that right ?
That would mean that if a scope changes the CultureInfo at any time it could effect parallel running scopes ?
Since the RequestCultureProviders also just change the CultureInfo of the current Thread could that effect across scopes ??? I'm really confused.
Example :
- Scope No1 (Task 1, Thread 1) gets created
- Scope No1 sets CultureInfo to en-US
- Scope No2 (Task 2, Thread 1) gets created
- Scope No2 sets CultureInfo to de-DE
- Option A : Scope No1 accesses Resource File
Option B : Scope No1 creates multiple Tasks
What are the CultureInfos for Option A and Option B at those moments ?
How does Dotnet Core handle this ?
How does Dotnet Core seperate scopes ?