Preemptive Web Services Server and Client

Preemptive Web Services allow your applications to take full advantage of multi-core computers resulting in faster responses for simultaneous requests. It’s not only powerful, it’s also easy: from the Method Properties of any method, just select the “Can be run in preemptive processes” option and you’re off and running!

A 4D method can be preemptive or not according to compilation options and the use of the language, as explained in this post.

By default, when the Web Services Server receives multiple requests, it uses cooperative threads to process them, i.e., all processes running on a single core. Now if you allow your methods to be used in preemptive threads, 4D uses all of the available cores to run several jobs in parallel.

For example, the video below demonstrates a reduction of response time divided by 3:

As you can see, preemptive mode increases the speed of your requests because the power of all of the processors is engaged.

New Thread safe commands

All the commands of the Web Service are now thread-safe.

Server commands:

Client commands:

Fabrice Mainguené
• Product Owner •Fabrice Mainguené joined 4D Program team in November, 2016. As a Product Owner, he is in charge of writing the user stories then translating it to functional specifications. His role is also to make sure that the feature implementation delivered is meeting the customer need.After obtaining a Bachelor degree in Computer Science at CNAM, Fabrice joined a small software publishing company as a Windev developer. Then he worked for different companies in industry and trade areas as a Windev and web developer as well as technical advisor on new features.