Does threadpool get shared between application domains?

后端 未结 3 1592
终归单人心
终归单人心 2021-02-02 13:27

Consider a process which is creating multiple application domains. Do these Application domains share same thread pool? If yes, how is it coordinated between multiple applicatio

3条回答
  •  野的像风
    2021-02-02 13:58

    The threadpool is shared between all appdomains, as each threadpool thread is context-agnostic and the whole threadpool runtime profile is highly dependent on the hardware you are running on (# of procs, hyperthreading and such)

    There is one thread pool per process. The thread pool has a default size of 25 threads per available processor. The number of threads in the thread pool can be changed using the SetMaxThreads method. Each thread uses the default stack size and runs at the default priority.

    Source : http://msdn.microsoft.com/en-us/library/system.threading.threadpool.aspx

    If I remember correctly, the CLR handles the threadpool threads internally and cleans the thread context before serving another work request.

提交回复
热议问题