From: <jc...@fe...> - 2003-03-06 16:28:23
|
On Wednesday 05 March 2003 00:06, Joao Cardoso wrote: | Hi, | | The xwin driver has been plagued for ages with a severe problem: | whenever the user program goes to lengthly calculations, without | doing any calls to PLplot, the plot window couldn't be refreshed if | obscured by other windows. Nor resized. | | You can quickly watch this behavior if you insert a getchar() | statement just before plend() in x01c.c. The getchar() call simulates | the user program doing other jobs and not calling any plplot API. If | you now obscure the plot window you will see that it is not redrawn | (of course). | | This behaviour is most inconvenient for interactive languages like | Octave or python, where the same behaviour is observed while the user | is typing commands at the prompt. | | The obvious solution would be to write a xwin server or daemon, like | the tk driver plserver, but that means a lot of work. Instead, I have | implemented, and cvs commit, a threaded xwin driver. It updates and | resizes the plot window, if needed. | | This feature is disabled by default at configure time. | | For most compiled programs, it can be safely turned on, even if the | host program is not threads aware. | For already build programs that somehow use PLplot, usually loading | it as an extension, as Octave or python or tk does, things are a bit | complicated, as those programs must themself be linked with the | pthread library, even if not thread aware! | | For example, in my system Octave is build by default without being | linked with pthreads, because Octave is not threads aware. To use the | new threads enabled xwin driver, I have to *relink* (only) octave | with -lpthread, and after that all goes well. | | Python, by contrary, is already linked with the pthreads library, so | nothing special needs to be done -- the threads enabled xwin driver | works without a problem with python. | | This is the reason why --with-pthreads=no by default, and should not | be turned on. Perhaps in a future development it will be enabled by default at configure time but disabled by default at run-time. To enable it at run-time one could use a driver-specific option, like -drvopt pthreads. This would be the best of both words. Joao |