Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to get a thread-safe Ghostscript compilation?

Tags:

c#

ghostscript

The new version of Ghostscript (9.07) has a threading support (can be thread-safe), but it says that the code must be compiled with a special flag to enable this.

How do I do this? Or where can I get already built thread-safe version?

I tried to download the source, opened in VS, but it failed to build. So maybe somebody has already done this and could share the DLL.

like image 553
net_prog Avatar asked Jul 12 '26 07:07

net_prog


2 Answers

Are you interested in the thread safe version of Ghostscript, or multiple rendering threads?

Multiple rendering threads are only of use if you are producing high resolution output, since the code must first interpret the PostScript program (or PDF file) and create a display list for the rendering threads to operate on. Unless you are rendering to a reasonably high resolution, this will actually be slower than using page mode (whole page rendered in memory)

You can create multiple rendering threads in the pre-built version of Ghostscript using the -dNumRenderingThreads switch.

If you want a thread-safe version of Ghostscript then you will need to be able to compile Ghostscript yourself. What version of Visual Studio are you using ? I am using Visual Studio 2005 and 2008 and the supplied solution works for me (after appropriate conversion).

like image 176
KenS Avatar answered Jul 14 '26 19:07

KenS


I was looking for solution for this problem as well and eventually I solved it in Linux. Maybe it will help someone who comes here looking for solution. Open terminal in sources directory and type this command:

./configure --enable-threadsafe

After that you can do make or make so for lib. Here is link to docs for building ghostscript from sources: https://www.ghostscript.com/doc/9.23/Make.htm#Makefile_overview.

like image 22
Herman Avatar answered Jul 14 '26 19:07

Herman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!