PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Managing the multi-processors
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
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.
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:
threadAuto
(Default value)
threadAuto
Automatic management of critical sections: each procedure or method can be run by a single thread at a time.
threadCriticalSectionthreadCriticalSection
(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:
threadMultiProcessor
(Default value)
The threads are automatically distributed among the different processors or among the different cores.
threadMonoProcessorAll the threads of the application are run on a single processor or on a single core.

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:
threadAuto
(Default value)
threadAuto
Automatic management of critical sections: each procedure or method can be run by a single thread at a time.
threadCriticalSectionthreadCriticalSection
(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:
threadMultiProcessor
(Default value)
The threads are automatically distributed among the different processors or among the different cores.
threadMonoProcessorAll the threads of the application are run on a single processor or on a single core.
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 : wd240vm.dll
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment