Multithreaded GUI issues



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.



.



Relevant Pages

  • Re: Display problem in JEditorPane
    ... Graphics context that is not the GUI. ... The problem is that immediately after I load the document, the images seem ... JEditorPane is finished drawing. ... Additionally there may be a problem that simple drawing of the JEditorPane ...
    (comp.lang.java.programmer)
  • Re: Looking for information on MFC TCP Communication
    ... > Note that to use the MFC socket classes the separate threads must be UI threads, ... > there is rarely a need to use separate threads. ... > objects, and not touching the GUI, there are no "thread issues". ... allocate the buffer, but this may be allocating / deleting alot of ...
    (microsoft.public.vc.mfc)
  • Re: Too many Post Messages causing app not to refresh
    ... When I had async network ports with well over 100 concurrent connections, ... async sockets in separate threads, so that its GUI was not swamped. ... messages required any GUI updating; most went to a database directly. ...
    (microsoft.public.vc.mfc)
  • Re: Recording mouse button down event continuously??
    ... continuously on an image displayed in a gui figure. ... I have a figure with two images shown in it. ... If the user presses right button it should change the state ... There are callbacks for WindowButtonUp, Down, ...
    (comp.soft-sys.matlab)
  • java memory error with cpselect
    ... step is to select control points for a bunch of images at once. ... running cpselect repeatedly from the command line, so it's not my GUI ... I've increased the maximum java memory to 66% of my physical memory ...
    (comp.soft-sys.matlab)