Re: win32lib et multitasking
- Posted by chadal <francois.chadal at girce.caisse-epargne.fr> Nov 09, 2006
- 703 views
Ryan W. Johnson wrote: > > I was under the impression that libraries like win32lib and wxEuphoria would > not work with multitasking, because the winMain() (or equivalent) procedure > does not have a task_yield() statement, and therefore will not give up control > of the main task to the scheduler. I would that that this statement would have > to be added for multitasking to work with these libraries. > > For example, a win32lib application main loop is basically something like > this: > > }}} <eucode> > procedure eventLoop(integer id, atom Flag) > --SNIP-- > -- message loop > while Flag != 0 > and ActiveEL[el] = 0 > and vWinMainState = kStarted do > --SNIP-- > > w32Proc( xTranslateMessage, { msg } ) > w32Proc( xDispatchMessage, { msg } ) > Flag -= inc > --ADD THIS STATEMENT HERE: > task_yield() > > end while > --SNIP-- > end procedure > > global procedure WinMain( object id, integer style ) > --SNIP-- > -- Start processing the message events. > eventLoop(0, -1) > --SNIP-- > end procedure > > WinMain(winmain, 0) > </eucode> {{{ > > What I'm saying is, I would think that this main loop in win32lib.ew that > handles > the win32 messages would need task_yield() added. (Similar circumstance in > wxEuphoria, > too). Am i correct? That's true. I've put two task_yield() statements in two procédures called by setHandlers to work with pre-emptive events from sockets and own winmsg. But for the moment, i've some trouble with win32lib and multitasking. I'm searching for what is wrong in my programs or win32lib or ....and without knowing how to search in depth....that's my first problem. > > ~Ryan W. Johnson > > Fluid Application Environment > <a href="http://www.fluidae.com/">http://www.fluidae.com/</a> > > [cool quote here, if i ever think of one...] regards, François Chadal