Prototype and description of the function setmultithreading()

(This function needs no unlocking)

 

setmultithreading()
Switching of the use of the GeoDLL functions in a multithreading
environment.

Prototype of the DLL function in C++ syntax (attend lower case!):
extern "C" __declspec(dllimport) unsigned long __stdcall setmultithreading(
     unsigned long lSwitch);

Prototype of the DLL function in Visual Objects syntax:
_DLL function setmultithreading(;
     lSwitch as logic);                    // 4 Byte
as logic pascal:geodll32.setmultithreading // 4 Byte


The function switches the use of the GeoDLL functions in a multithreading
environment on or off. If in lSwitch the value TRUE is passed, the
operating in a multithreading environment is possible, otherwise there will
come up complications while multithreading operating.

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

In doing so the critical section handler of WINDOWS is initialized. For
the following calls of GeoDLL functions for all critical sections, which
are passed through by the active thread, the critical section flag is set.
An active critical section flag prevents the critical sections from the
simultaneous using by several threads. All threads must wait, until the
active thread deactivates the critical section flag.

The use in a multithreading environment speeds down the performance of the
GeoDLL functions a little. By the call of the function setmultithreading()
with the parameter FALSE the multithreading ability is switched off.
Switching off is unnecessary, if the multithreading ability is needed up to
the application is terminated. The release of the resources bound by the
critical section handler is arranged by the GeoDLL.

There are further switches, which prepare GeoDLL for the operating in
different environments. These are the functions
      setstringallocate()
      setinternerrsys()
      setstaticuse()
      setsilence()
      seteventloop()

In a multithreading environment the automatic allocation of memory space
for global addresses [setstringallicate()] and the use of the internal
error processing routine [setinternerrsys()] must be switched off.


The parameters are passed and/or returned as follows:
lSwitch       Switch for the multithreading handling
TRUE          Multithreading handling on
FALSE         Multithreading handling off
              (default)

returnVal     In case of an error the function returns FALSE, otherwise TRUE.


Unlocking:
This function needs no unlocking.