On Monday 25 September 2017 14:24:17 fredvs wrote:
> > This night will be a merciless test, StrumPract will be the dj all night.
>
> Hello Martin.
>
> OK, the night was white.
>
> Strumpact did his DJ job perfectly, no crash, no pause.
>
Congrats!

> The only detail is when a thread is synchronizing graphic of a other form
> (not the parent form of the thread).
>
> It produce some underrun of the external thread.  The result is some
> "scratch" in sound.
> (I did add a checkbox to disable view meter in Commander form.  If enabled
> ---> underrun.)
>
How do you do that? application.lock()/unlock()? That will wait until the main 
thread is in idle state (same as "synchronize()")

An alternative is application.postevent() which does not wait.
You also can use <theform>.asyncevent() in order to send and 
<theform>.onasyncevent in order to receive an event or 
<theform>.postcomponentevent() to send and overriding 
<theform>.componentevent() to receive. I'll probably add 
tform.oncomponentevent for convenience.

Another option is application.queueasynccall() which internally also uses 
event objects.

> But maybe it is not a good idea to synchronize things of a other form than
> parent-thread form.
>
There is no "parent-thread" for a form, there is solely a single main thread 
with a single main event loop which runs the GUI code for all forms.

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to