in reply to Re^11: Tk and Threads
in thread Tk and Threads
Your interesting solution, would require spawning 1 primordial virgin thread, which is used for nothing more than to spawn more clean threads. Because that virgin copy, cannot import any modules, without polluting it's own next copy, it can only have a breeder function. Having that breeder thread laying there, just to spawn more, is quite wasteful.
On linux, there comes a time to fork. I advocate forking from the threads, so that the threads only get created once, and act as controllers for the forked code they run.
This is the big difference between threads on Windows and Linux. On linux, there is a distinction between forking and threads, whearas on Windows fork() is emulated.
On linux, forking code has many advantages over threads, the memory cleanups are better, and probably faster, and thread safety of modules becomes a non-issue.
|
|---|