Closed HeadOnBenni closed 4 years ago
Hi!
Currently the .NET SDK is not intended for use in a multi-threaded environment.
Hi @auxdevelopment ,
thanks for the feedback. Does this mean that if I create a separate instance for each thread, no problems will occur? Or is the fiskaly-client.dll not thread safe and I have to make sure that this dll is never accessed simultaneously?
Thanks for your support!
Hi!
Regarding the SDK this wouldn't be an issue.
The real issue would be a different one though because you cannot (to my knowledge at least) load a static library (the DLL) into a process more often than once. Because the SDK implicitly tries to load the client library, your approach would lead to an error.
Hi @auxdevelopment ,
thanks for the feedback. Since the Windows client does the import via a static instance variable, the DLL is loaded only once, as far as I know. Therefore several instances would access the "same" DLL. Can the DLL handle multiple threads accessing it at the same time? Or exactly is the code inside the "com.fiskaly.client-windows-amd64-v1.2.000.dll" thread safe?
Hello,
in that case accessing the library from multiple threads shouldn't be an issue.
Hello,
I am currently using the .NET SDK to send requests to Fiskaly from a mutlithreaded program. In the example on your GitHub page, you are using the client in a static variable, but I can't quite deduce from the source code whether the FiskalyHttpClient or the FiskalyHttpClient's request method is really thread safe. Could you please help me here?
Thanks in advance.