Click here to Skip to main content
15,884,981 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hopefully I ask this right... but then it is about threading.
We have an older version (9.08) of the Ghostscript dll that was compiled with the thread safe flag. Without it, all my tests up to version 9.20 have shown that of 10 simultaneous threads, about 4 tend to fail to convert PDF to PostScript.
One of our developers has wrapped version 9.51 (64 bit... cool) in a mutex semaphore. Now if I understand correctly, that would make it thread safe, but only by making sure that only one document was processed by the dll at a time so processing would be sequential, not parallel. Is that correct?

What I have tried:

I have a test harness, so I guess I could do a performance test on it.
Posted
Updated 17-Mar-20 7:42am

Assuming the entire process is blocked by the semaphore, then your assumption is correct. If the latest version(s) of Ghostscript are not thread safe then there is not much you can do. You could try running the conversions as separate processes, if that is possible.
 
Share this answer
 
Here is some information from the writer of C# in a Nutshell: Threading in C# - Part 2 - Basic Synchronization[^]
So a Mutex, if implemented correctly, is not only thread-safe but also works system wide for applications.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900