[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Pkg-grass-general] Re: mapserver work



On Thu, Dec 02, 2004 at 10:28:24AM -0800, Jon Saints wrote:
> Thomas 
> 
> would you mind explaining the "thread-safe problem" to
> the list in more detail?  The more of us that
> understand it, the more we might be able to work for a
> solution.  
> 

Generally, thread-safeness can be explained in a few words:

A thread-enabled program uses threads of execution, i.e.
light-weight processes which all share the same addresses space
but for their stacks (i.e. 'auto' or local variables and function arguments). 
This implies that all shared resources (all static and global data, for
instance) are subject to concurrent accesses and require an inter process
communication mechanism (i.e. semaphores or mutex) to be used in 
read/write access.

So code needs to be thread-safe to be implemented properly.

This requires writing reentrant code (i.e. code which works with
local variables only) or using semaphores in advisory mode in
order to access properly global data.

Nice, uh?

-- 
Francesco P. Lovergine



Reply to: