Re: newb-like question on threads



On Jul 31, 4:16 pm, "Scott McPhillips [MVP]" <org-dot-mvps-at-
scottmcp> wrote:
djarvi...@xxxxxxxxx wrote:
OK, so I thought I knew what a 'thread' was. But maybe not anymore...

Basically, I just took the quick & dirty view that a thread was just a
path of execution for an app. But anyway...

I found this line of documentation for a function I wanted to use:

"XXXEvent() does not return until the specified event occurs. For
this reason, it is best used inside of a thread."

Um... OK, newbiness now. How would I (not that I want to) get this
function 'outside' of a thread?

Thanks.

The documentation probably meant "best used inside of a secondary
thread." The primary thread of a GUI program must continuously process
messages, so using wait/blocking functions inside the main thread is a
design mistake in a GUI.

Ah, thanks. Your explanation makes perfect sense.

.



Relevant Pages

  • Write code to minimize to tray
    ... I've searched for the documentation on this, and can't find it for some ... reason. ... How do you make an app minimize to the system tray? ...
    (microsoft.public.vc.mfc)
  • Re: Any info about "Thread has exited with code 32772 (0x8004)"?
    ... I define the problem out of existence by saying if the return code ... GUI program return any known or specific competion code upon completion. ... obviously there is a reason to return a valid code. ... So I don't agree that returning a valid code is hard. ...
    (microsoft.public.vc.mfc)
  • Re: newb-like question on threads
    ... I just took the quick & dirty view that a thread was just a ... path of execution for an app. ... The primary thread of a GUI program must continuously process messages, so using wait/blocking functions inside the main thread is a design mistake in a GUI. ...
    (microsoft.public.vc.mfc)
  • Re: command line starkit
    ... I'm writing an app that in some invocations needs to be ... a GUI program with Tk, and at other times it wants to be ... it always load Tk and loses stdout. ...
    (comp.lang.tcl)