From: <jc...@fe...> - 2003-03-05 13:40:53
|
On Wednesday 05 March 2003 01:16, Alan W. Irwin wrote: | On Wed, 5 Mar 2003, Joao Cardoso wrote: | > 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! | | I believe the best solution here is simply to link xwin with | -lpthread consistent with the hierarchichal linking paradigm we are | using. That way, all pthread symbols in the xwin driver should be | resolved, and you shouldn't have to do any special linking of octave, | wish, tclsh, etc. This is for the dynamic drivers case. In the | static drivers case it is a little bit more complicated; the xwin | driver becomes part of libplplot, and therefore, libplplot has to be | linked with -lpthread. | | The short story: make Makefile.am changes for the xwin driver | following what happens for the gd driver special libraries (libgd, | libpng, etc) as a model both for the dynamic and static drivers | cases. | | If you or Rafael don't have time to fiddle with this, I will have a | look this weekend. If it works out, then perhaps you will not have | to turn off pthreading by default. I don't things are as simple as that. Adding the pthread library to a program not only adds more functionalities to it but also changes the way how it is executed and how certain global variables (errno, e.g.) are acessed. When a program not linked with pthreads loads the xwin driver, and implicitly the pthreads library, as you suggest, it is too late for it to adapt to the new execution model. But you can try. I'm no threads expert. Don't forget to try with already compiled programs that load plplot, octave or python, e.g., and are/are not linked with pthreads by default. Please report your experiences before commiting things. Joao | | Alan | __________________________ | Alan W. Irwin | email: ir...@be... | phone: 250-727-2902 | | Astronomical research affiliation with Department of Physics and | Astronomy, University of Victoria (astrowww.phys.uvic.ca). | | Programming affiliations with the Canadian Centre for Climate | Modelling and Analysis (www.cccma.bc.ec.gc.ca) and the PLplot | scientific plotting software package (plplot.org). | | __________________________ | | Linux-powered Science | __________________________ |