Windows thread pool

Python python at python.com
Mon May 19 16:01:12 UTC 2025


If I am using the integrated Windows Thread Pool (1), how this 
will interact with garbage collection? Is there any risk that 
some objects are never freed or some are freed too soon? Can the 
garbage collector stop the threads as needed?

I am asking that because I cannot use the managed 
core.thread.Thread having gc support, nor I can use attachThis() 
since the nature of the Win thread pool is dynamic, threads are 
created dynamically by OS depending on several factors, I have 
access only to the callbacks run on these threads.

(1) 
https://learn.microsoft.com/en-us/windows/win32/procthread/thread-pool-api

Thanks.




More information about the Digitalmars-d-learn mailing list