You are not logged in.
Pages: 1
I try to use crossplatform library in my multithread application...
and I get some strange access violation exceptions...
To start discussion I have one question:
Is crossplatform library thread-safe at all ?
Thanks.
Offline
No it is not thread-safe by itself.
As soon as each thread has its own TSQLRestClientHTTP, it is thread safe.
Or you can protect the access to a single TSQLRestClientHTTP instance using a mutex/CriticalSection/TMonitor.
Offline
Thanks a lot.
could you provide an example/manual/instruction please?
Offline
Will Every thread have own TSQLRestClientHTTP with own server-session (authentication, session id and so on) ?
Do you offer that?
Thanks a lot.
Offline
Each TSQLRestClientHTTP instance maintains its own session.
So for a basic client, a single TSQLRestClientHTTP protected by TMonitor may be enough:
TMonitor.Enter(FClient);
try
// protected code using FClient: TSQLRestClientHTTP
finally
TMonitor.Exit(FClient);
end;
Offline
ok, thanks a lot for the help.
We will try.
Offline
Pages: 1