4D v16.3Using preemptive Web processes |
|||||||
|
4D v16.3
Using preemptive Web processes
Using preemptive Web processes
The built-in Web Server of 4D 64-bit for Windows and OS X allows you to take full advantage of multi-core computers by using preemptive Web processes in your compiled applications. You can configure your Web-related code, including 4D tags and Web database methods, to run simultaneously on as many cores as possible. For more information on preemptive process feature in 4D, please refer to the Preemptive 4D processes section. The use of preemptive mode for Web processes is only available in the following contexts:
If any requirement is missing, the Web Server will use cooperative processes. To enable the preemptive mode for the Web Server code of your application, you must check the Use preemptive processes option on the "Web/Options (I)" page of the Database Settings dialog box: When this option is checked, the 4D compiler will automatically evaluate the thread-safety property of each piece of Web-related code (see below) and return errors in case of incompatibility. All 4D code executed by the Web Server must be thread-safe if you want your Web processes to be run in preemptive mode. When the Use preemptive processes option is checked in the Database Settings dialog box, the following parts of the application will be automatically evaluated by the 4D compiler:
For each of these methods and code parts, the compiler will check if the thread-safety rules are respected, and will return errors in case of issues. For more information about thread-safety rules, please refer to the Writing a thread-safe method paragraph. Starting with 4D v16, most of the Web-related 4D commands, database methods and URLs are thread-safe and can be used in preemptive mode: All 4D Web-related commands are thread-safe, i.e.:
The following database methods are thread-safe and can be used in preemptive mode:
Of course, the code executed by these methods must also be thread-safe. The following 4D Web Server URLs are thread-safe and can be used in preemptive mode:
The following 4D Web Server URLs are not thread-safe and not supported in preemptive mode:
Both the Runtime Explorer and the 4D Server administration window display a specific icon for preemptive Web processes:
See also
|
PROPERTIES
Product: 4D
HISTORY
ARTICLE USAGE
4D Language Reference ( 4D v16) |
|||||