As of revision 9546, I have completed the first pass at a new, more powerful
public API for libqsastime.  This (new) public API is documented in
README.qsastime_API and qsastime.h and largely consists of powerful wrappers
for the internal helper functions which are well-tested by qsastime_test and
qsastime_testlib.  Right now the only transformations available are
Gregorian versus Julian and arbitrary linear transformations of the
continuous time variable.

Immediate future plans include generalizing configqsas so there is an option
to specify the offsets by using broken-down time rather than directly.
(Thanks to Andrew Ross for this suggestion.)

More distant future plans include putting in the transformation (e.g., leap
seconds) between UTC broken-down time and atomic-clock based times such as
TT. Eventually, I plan the default transformation to be UTC broken-down-time
to a continuous TT time in seconds since the TT epoch, but for now the
default transformation (flagged by a zero scale) is Gregorian broken-down
time (with leap seconds ignored) to seconds since the Unix epoch of
1970-01-01 (with leap seconds ignored).

All the helper functions (some of which are tested by qsastime_test and
qsastime_testlib) are now not explicitly visible.  That is, if you use the
-fvisibility=hidden option for gcc, the helper functions will not be
available for linking (which is a good thing since we want to keep them
private).

An issue for libqsastime at the present time is it is not thread safe
because of the global qsasconfig pointer to a QSASConfig struct that
contains all the information necessary to configure the corrections and
linear transformations made to transform between continuous and
broken-down-time (and vice versa).

Ideally, libqsastime should be made thread safe since that makes it much
more useful to users who I assume will be using it independently of PLplot
(which is not thread safe, itself, but that is a separate issue) for
threaded applications on their multi-processor boxes in the future.  I have
read
http://publib.boulder.ibm.com/infocenter/systems/topic/com.ibm.aix.genprogc/doc/genprogc/writing_reentrant_thread_safe_code.htm
which indicates you have to do something special to make libraries with
global data such as global pointers thread-safe, but it doesn't say what.
Could somebody help me with this issue, please?

I have changed plbox.c to use the new public API for libqsastime in a
minimal and rather crude way as a proof of concept.  Everything builds
without issues on my platform and produces identical example 29 results.

Tomorrow I hope to (finally) start (and also finish) implementing a PLplot
public time API for the C language which will be much less crude than what
currently happens in plbox.c. now.  This PLplot API will be based on
configqsas, btimeqsas, ctimeqsas, and strfqsas.  (closeqsas will just be run
automatically whenever we run plend so will not require a PLPlot API to wrap
it).  The new PLplot time API will eventually be propagated to all our
languages, and it will also be used for example 29 so that all the
cross-platform issues we had before with the C library time functions, the
diverse (and sometimes non-existent) time functions for non-C languages, and
the difficulty we had turning off time zone corrections that we didn't want,
will all be solved in a uniform way.  We have been looking forward to
accomplishing that goal for a long time so it is really nice to see it
getting so much closer to hand.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to