in reply to Re^4: bidirectional pipe freezing
in thread bidirectional pipe freezing
With this approach (at least on my platform) you don't even need require. You can go ahead and use Tk.
Indeed, it works fine like that. The only downside is that your threads will 'inherit' various bits of Tk code and data that they cannot use.
Whilst the additional memory consumed is insignificant unless you are really pushing the boundaries of your system, the fact that the Tk::* name space is visible within your threads can lead to the temptation to try and use it.
What is worse is that sometimes, some calls will actually seem to work. Until they stop -- usually by crashing -- that is :)
I like the discipline, and removal of temptation, that requireing Tk after I've set up my workers brings. The only downside I see is that you have then to use Tk::MainWindow->new(); and Tk::Mainloop() etc. It is even possible to bypass that by an appropriate call to Tk->import (Or is it Tk::import;?), but I never seem to get that right first time.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: bidirectional pipe freezing
by chessgui (Scribe) on Dec 21, 2011 at 21:13 UTC | |
by BrowserUk (Patriarch) on Dec 21, 2011 at 22:43 UTC | |
by chessgui (Scribe) on Dec 21, 2011 at 23:31 UTC | |
by BrowserUk (Patriarch) on Dec 22, 2011 at 00:32 UTC |