ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Process functions / Threads, semaphores, signals and mutex
  • Managing the multi-processors
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
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.
Universal Windows 10 AppAndroidAndroid Widget Java ThreadMode has no effect: the management mode is always 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 be run by a single thread at a time.
threadCriticalSection
(Default value)
Manual management of critical sections: each procedure or method can be run 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.
Universal Windows 10 AppAndroidAndroid 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 be run by a single thread at a time.
threadCriticalSection
(Default value)
Manual management of critical sections: each procedure or method can be run 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.
Universal Windows 10 AppAndroidAndroid 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 mode is used to restore the standard operating mode: in this case, the system automatically manage the distribution of the threads on the processors or on the cores.
Component: wd290vm.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/21/2023

Send a report | Local help