[GRASS5] Are GRASS Library functions thread-safe?

Hi,

I want to know the GRASS library functions (from GIS
Library, Vector Library, and Segment Library) are
thread-safe or not?

Thanks,
Shifeng

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

zhang ji wrote:

I want to know the GRASS library functions (from GIS
Library, Vector Library, and Segment Library) are
thread-safe or not?

No. The GRASS libraries are a very long way from being thread-safe.

This isn't just an implementation detail; i.e. we can't just change
the "internals" of the libraries to make them thread-safe. We would
also need to substantially change the programming interface.

--
Glynn Clements <glynn.clements@virgin.net>

On Tue, 17 Jun 2003, zhang ji wrote:

Hi,

I want to know the GRASS library functions (from GIS
Library, Vector Library, and Segment Library) are
thread-safe or not?

Thread-safeness is quite new, and related to GUIs (they need to keep on
being responsive when the actual program is doing useful work). Further,
GRASS is Unix at base, where typically new discrete processes are forked
when needed, rather than being sliced into threads. I think you can safely
assume that GRASS library code is not thread-safe, because most of it was
written before threads began to be important, because GRASS uses Unix
conventions (creating new processes where needed), and because GUI in
GRASS is an afterthought, not the design principle. Experience in other
areas of scientific computing suggests that threads are a red herring when
there is serious computing to be done.

Roger Bivand

Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
e-mail: Roger.Bivand@nhh.no