Multithreaded GUI issues
- From: "pedrito" <pixbypedrito at yahoo.com>
- Date: Mon, 20 Aug 2007 21:22:04 -0500
I posted an issue a couple of days ago that nobody has answered anything on
yet (re: error in System.Net.OSSOCK.closesocket()) and I'm starting to
wonder if maybe my problem lies elsewhere.
As I mentioned in that post, the app is multithreaded. It downloads from a
number of threads simultaneously. There are 4 or 5 events that can come off
of these separate threads.
In each of these cases, where the events get passed on to GUI components,
they're Invoked into the GUI thread.
But then it occurred to me, is there a specific "line in the sand"? What GUI
methods are callable from separate threads and which ones aren't?
For example, some of these threads might download images and in those cases,
I'm creating Image objects (on non-gui threads) to get information about the
images (dimensions mainly), though they're never drawn. But does this
constitute the wrong side of the line?
Clearly some GUI-side methods can, and should be called from separate
threads. Control.InvokeRequired and Control.Invoke(), obviously.
Is there a list somewhere of what's safe and what's not safe to call from a
non-gui thread? I mean, sometimes it's hard to know for sure if something in
the framework is eventually going to do GUI side work even though it might
not be apparent from the call.
Thanks.
.
- Follow-Ups:
- Re: Multithreaded GUI issues
- From: pedrito
- Re: Multithreaded GUI issues
- From: Peter Duniho
- Re: Multithreaded GUI issues
- Prev by Date: Help with replacement pattern
- Next by Date: Re: A question on the RECT struct
- Previous by thread: Help with replacement pattern
- Next by thread: Re: Multithreaded GUI issues
- Index(es):
Relevant Pages
|