From: Joao C. <jc...@fe...> - 2003-03-05 00:11:15
|
Hi, The xwin driver has been plagued for ages with a severe problem: whenever= the=20 user program goes to lengthly calculations, without doing any calls to=20 PLplot, the plot window couldn't be refreshed if obscured by other window= s.=20 Nor resized. You can quickly watch this behavior if you insert a getchar() statement j= ust=20 before plend() in x01c.c. The getchar() call simulates the user program d= oing=20 other jobs and not calling any plplot API. If you now obscure the plot wi= ndow=20 you will see that it is not redrawn (of course). This behaviour is most inconvenient for interactive languages like Octave= or=20 python, where the same behaviour is observed while the user is typing=20 commands at the prompt. The obvious solution would be to write a xwin server or daemon, like the = tk=20 driver plserver, but that means a lot of work. Instead, I have implemente= d,=20 and cvs commit, a threaded xwin driver. It updates and resizes the plot=20 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=20 program is not threads aware. For already build programs that somehow use PLplot, usually loading it as= an=20 extension, as Octave or python or tk does, things are a bit complicated, = as=20 those programs must themself be linked with the pthread library, even if = not=20 thread aware! For example, in my system Octave is build by default without being linked= with=20 pthreads, because Octave is not threads aware. To use the new threads ena= bled=20 xwin driver, I have to *relink* (only) octave with -lpthread, and after t= hat=20 all goes well. Python, by contrary, is already linked with the pthreads library, so noth= ing=20 special needs to be done -- the threads enabled xwin driver works without= a=20 problem with python. This is the reason why --with-pthreads=3Dno by default, and should not be= turned=20 on. But users must know that this feature is available and why it is turned o= ff,=20 so they can turn it on if that is the appropriate action for them. Enjoy, Joao |