Use in a multithreading environment

 

 

Multithreading environment

The Dynamic Link Library GeoDLL can be used in single threading and multithreading environments. To the run the DLL safe in a multi threading environment the operating system WINDOWS provides suitable functions, which are used inside the DLL.

 

In principle, a flag is used which signals the competing threads whether critical sections inside the DLL are just available. This role is taken by the Critical Section of the Windows-API. For further information, please search the Internet for the concept "EnterCriticalSection".

 

After the program start and loading the GeoDLL the operating in a multithreading environment is switched off as default. The first thread must call the function setmultithreading() with the parameter TRUE, in order to cause the multithreading ability.

 

There are further switches, which prepare GeoDLL for the operating in different environments. These are the functions:

setstaticuse() - Switching on/off the use of faster static-variables
setstringallocate() - Switching on/off the automatic memory management

 

To prepare the DLL for multithreading, the below functions with parameters as shown must be called before the first geodetic calculation:

Setmultithreading(TRUE)
setstringallocate(FALSE)