You are not logged in.
Pages: 1
Sometimes I need to create new threads inside rest server methods to perform some actions. For example I'd like to return as soon as possible, so part of work can be redirected to separated thread. Additional thread isn't executed always. I wonder, maybe there is some nice technique in mormot to auto free the threads? I'd like to perform auto free when thread "Execute" was ended.
At the moment I have for that purpose my own structures.
best regards,
Maciej Izak
Offline
Hi,
this behaviour is alteady implemented in:
TThread.FreeOnTerminate:=true;
Offline
that won't work for console/service application (eventually "Classes.CheckSynchronize" call is needed but I like to avoid that)
best regards,
Maciej Izak
Offline
Check the TSynBackgroundThread* classes in SynCommons.pas.
You have several ways of implementing it in mORMot.
Those classes are used by low-level execution threading abilities of the framework.
Offline
Pages: 1