You are not logged in.
For the HTTP mORMot architecture, the server can handle multiple clients (via http.sys or the other pure-pascal implementation) simultaneously (as seen at the client side) .
For the stand-alone mORMot architecture, can one server and multiple clients (one client per thread) coexist ? The reason to ask is that this might be thought as "producer-consumer" situation.
For example, if I create one TSQLRestServerDB, and use this existing TSQLRestServerDB to create multiple TSQLRestClientDB instances (one client per thread):
Can the server handle the underlying ORM thread-safely ?
How does the server achieve the ORM thread-safety ? Through a queue, or via spawned threads (e.g., TSQLRestClientDB spawns threads to deal with each request of TSQLRestClientDB, when the request of customized service-method takes quite a long time to complete ) ?
Are there special things to pay attention to, for example, in the URI or customized service-methods in the TSQLRestServerDB, to ensure thread-safety for this situation ?
Last edited by ComingNine (2014-05-07 14:33:28)
Offline
Please ensure you read the "Thread-safety" paragraph in the latest version of the SAD 1.18 pdf.
Also search for "Multi-Thread" in the keyword index at the beginning of the PDF.
You will find here the answers to your questions.
In short, there is no thread created per client: this won't scale.
But there are a lot of options to be tuned for thread on server side execution, mainly:
- the TSQLRestServerURI.AcquireExecutionMode[] property for the global server process,
- and TServiceFactoryServer.SetOptions() for interface based services.
Our little mORmot is pretty configurable and versatile about thread-safety.
Offline