Quoting Marcus Smith <[EMAIL PROTECTED]>: > Hi, > > I'm running into an issue w.r.t picogui and threading. My application > > requires threading because widgets are > modified *atfer * pgEventLoop() is called. Other threading issues > surface if the "main" thread iterates on pgEventPoll() and > the other thread modifies a widget property. In this case, polling is
Yes, the current PicoGUI client library is not thread safe. PicoGUI API calls should only be made from one thread. It would be good to include threading support in the client lib, but none of the applications written so far have needed it. The standard pgEventLoop() is very flexible: the application can set callbacks for widget events using pgBind(), have a function called periodically using pgSetIdle(), or wait on its own file descriptors using pgCustomizeSelect(). pterm and pgtuxphone are good examples of using pgCustomizeSelect() to access other devices and picogui simultaneously. > > not an option because all our apps will utilize blocking I/O > to lessen CPU utilization. Has anyone else tried a simple program to > modify a widget property (like text for a label) in one thread, > while another thread runs pgEventLoop()? The main problem with this is that any picogui request will take the client out of its event wait mode, and the event loop would need to be kickstarted using ping and wait requests. (as is currently done to handle pgSetIdle and pgCustomizeSelect) Of course concurrency issues must also be considered: you can't send another request before the response to a previous one has come in. > > I have a proposed modification to pgui to allow the client to be thread > > safe, but it is rather extensive. I thought I'd try the mail > list to see if any others have encountered this issue. Yes, we'd be glad to hear your suggestions. > > Marcus Smith > RidgeRun Inc. > > > _______________________________________________ > Pgui-devel mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/pgui-devel > -- Only you can prevent creeping featurism! _______________________________________________ Pgui-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/pgui-devel
