> Maybe I overestimate how complicated a message queue is, but AFAIKT
> there would still be a need for something that would check the queue
> periodically. Now on windows there are OS primitives (at least that's
> how I always looked at them) like the
> GetMessage/TranslateMessage/DispatchMessage loop that block when there
> are no messages waiting - an efficient solution. With a home-brew
> queue I'd need to set a timer that would check the queue every once in
> a while (correct me if I'm wrong).

Unless you decide to use a more advanced technique (like waiting on a mutex)
which is available on your target platform, then you're right.

> Well the absence of a message queue. Like I said above, maybe I
> overestimate the difficulty in writing one for a non-gui program, but
> for the two gui environments I'm supporting I have access to the
> message queues those environments provide while for a console version
> I'd have to write my own (or come up with a whole other mechanism).

FYI a message queue is associated with a thread, so any thread can have its
own message queue.  This includes threads running CUI apps.  There's nothing
to prevent a CUI app to use a message queue.  In fact, there's nothing to
prevent a CUI app from creating a window (ever tried calling MessageBox( )
from a console app), just like nothing prevents a GUI app from allocating a
console.

Hope this helps,
-------------
Ehsan Akhgari

List Owner: [EMAIL PROTECTED]

[ Email: [EMAIL PROTECTED] ]
[ WWW: http://www.beginthread.com/Ehsan ]

It is dreadful to die of thirst in the sea. Do you have to salt your truth so
much that it can no longer even - quench thirst?
-Beyond Good And Evil, F. W. Nietzsche





Reply via email to