From: Charles A. <cha...@al...> - 2008-06-18 18:44:39
|
----- Original Message ----- From: Jan Dubois <ja...@ac...> Sent: Wed, 18 Jun 2008 10:58:28 -0700 Re: RE: [perl-win32-gui-users] Avoid the appearance of a "frozen" window > You are not really supposed to use GUI handles from a thread that doesn't > own them (the one that has created them). While "read" access is generally > safe, modifying GUI objects from non-owning threads isn't. For example: > > http://blogs.msdn.com/oldnewthing/archive/2005/10/10/479124.aspx > > Cheers, > -Jan > > Sure, race conditions and IPC are always issues to consider in multi-threaded applications. But, I don't think there is anything inherently flawed with pre-spawning off threads as event handlers for the various gui elements on a window. Just build the app to not make changes to the window in those threads. In fact, I feel like that's a preferred approach to spawning off a new thread after the main thread handles window events. Pre spawning/forking/whatever shifts a lot of overhead to the application initial load time, which leads to a better user experience. Users hate waiting after clicking. All of this kind of feels like a hack to me (I know all of these problems have been solved a bajillion times before), but I don't consider myself a great GUI programmer. I picked Win32::GUI because it gave me an easy on-ramp to building a "professional" looking windows gui application. And this was the quickest, best way for me to get my code out the door... :) Thanks, Charles Alderman |