ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / Process functions / Threads, semaphores, signals and mutex
  • Managing the multi-processors
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
ThreadMode (Function)
In french: ThreadMode
Modifies the management modes of threads. The available management modes are as follows:
  • the automatic or manual management of the critical sections on the procedures and on the methods.
  • the distribution of the execution of the threads on the different processors or on the different cores of the computer.
The automatic critical sections prevent the execution of a procedure or method by several threads simultaneously. The automatic critical sections are enabled by default.
AndroidAndroid Widget Java The ThreadMode function has no effect: the management mode is still multi-processor, with manual management of critical sections.
Syntax

Modifying the management modes of threads Hide the details

<Result> = ThreadMode(<New management modes>)
<Result>: Integer
Management modes of threads before the modification, combination of the constants below.
<New management modes>: Constant or combination of constants
Mode for managing the critical sections of procedures and methods:
threadAutoAutomatic management of critical sections: each procedure or method can only be executed by a single thread.
threadCriticalSection
(Default value)
Manual management of critical sections: each procedure or method can be executed by several threads simultaneously. In this case, you must protect the accesses to the resources shared between the different threads by critical sections.
Distribution of the threads on the processors or on the cores:
threadMonoProcessorAll the threads of the application are run on a single processor or on a single core.
threadMultiProcessor
(Default value)
The threads are automatically distributed among the different processors or among the different cores.
AndroidAndroid Widget The constants corresponding to the repartition of the threads on the processors or on the cores are not available.

Retrieving the management modes of threads Hide the details

<Result> = ThreadMode()
<Result>: Integer constant (or combination of constants)
Current management modes of threads:
Mode for managing the critical sections of procedures and methods:
threadAutoAutomatic management of critical sections: each procedure or method can only be executed by a single thread.
threadCriticalSection
(Default value)
Manual management of critical sections: each procedure or method can be executed by several threads simultaneously. In this case, you must protect the accesses to the resources shared between the different threads by critical sections.
Distribution of the threads on the processors or on the cores:
threadMonoProcessorAll the threads of the application are run on a single processor or on a single core.
threadMultiProcessor
(Default value)
The threads are automatically distributed among the different processors or among the different cores.
AndroidAndroid Widget The constants corresponding to the repartition of the threads on the processors or on the cores are not available.
Remarks

Managing the multi-processors

This option should only be used in some advanced cases.
On a single-core single-processor computer, the threadMonoProcessor and threadMultiProcessor constants have no influence.
On a multi-core or multi-processor computer:
  • The threadMonoProcessor mode forces the application to use a single processor or a single core.
  • The threadMultiProcessor management mode allows you to return to normal operating mode: in this case, the system automatically manages the allocation of threads to processors or cores.
Component: wd300vm.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/24/2024

Send a report | Local help