Hi,Neither GUI is thread safe.You need call Thread GUI, to update the 
interface.From: http://webserver2.tecgraf.puc-rio.br/iup/MultithreadUser 
interface is usually not thread safe and IUP is not thread safe. The general 
recommendation when you want more than one thread is to build the application 
and the user interface in the main thread, and create secondary threads that 
communicates with the main thread to update the interface. The secondary 
threads should not directly update the interface.
Best,Ranier Vilela

> From: supp...@scriptbasic.org
> To: iup-users@lists.sourceforge.net
> Date: Thu, 1 Oct 2015 23:39:24 -0700
> Subject: Re: [Iup-users] Is Iup pthread safe?
> 
> Hi Andy,
> 
> IUP isn't thread safe by default but that doesn't mean it can't be done.
> Here is an example in Script BASIC (Windows & Linux)
> 
> http://www.scriptbasic.org/forum/index.php/topic,335.0.html
> 
> John
> 
> 
> On Fri, 2015-10-02 at 14:36 +1000, Andy Xiyue wrote:
> > Hi Scuri,
> > 
> > 
> > Recently I tried to use IUP with more than one thread. My plan is
> > simple, run IupMainLoop() in one thread and feed progress bar or text
> > control in another thread. Theoretically I don't need to synchronize
> > the IUP calls because the IupMainLoop() will process the events sooner
> > or later. However I met a lot of problems. Sometimes the client area
> > became invalided without refresh. Sometimes I got a core dump
> > triggered by X11 event. For example, the attached file was simplified
> > from my program. When the progress bar running, if you select text in
> > the text control, the app will received sig 11:
> > 
> > iqiup: Fatal IO error 11 (Resource temporarily unavailable) on X
> > server :0.0.
> > 
> > 
> > It looks like I misunderstood the programming model of IUP. Is IUP
> > safe to update the attribution of controls in different thread? If
> > it's not, how can I manually send events to the main loop to update
> > the controls?
> > 
> > 
> > Kind regards
> > 
> > Andy
> > 
> > ------------------------------------------------------------------------------
> > _______________________________________________
> > Iup-users mailing list
> > Iup-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/iup-users
> 
> 
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> Iup-users mailing list
> Iup-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/iup-users
                                          
------------------------------------------------------------------------------
_______________________________________________
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to