How do I make this function thread safe?

Dr.No jckj33 at gmail.com
Fri Jun 1 17:04:54 UTC 2018


On Friday, 1 June 2018 at 02:30:34 UTC, Paul Backus wrote:
> On Thursday, 31 May 2018 at 19:26:12 UTC, Dr.No wrote:
>> My application create some HTML which is then converted to PDF 
>> by wkhtmltopdf library. I'm trying to figure out how make the 
>> PDF generation run parallel, currently, it's running linearly.
>
> It looks like wkhtmltopdf does not support multithreaded use; 
> see here:
>
> https://github.com/wkhtmltopdf/wkhtmltopdf/issues/1711
>
> So, if you want to run the conversions in parallel, you will 
> have to use separate processes.

Can I run that function in another memory space within my 
application, making even __gshared be allocated in that memory 
space, so that it seems it is another process? it's quite similar 
to thread but everything is allocated in that new memory space 
including __gshared.
I started calling the wkhtmltopdf executable by I wanted to see 
if there's a signficative gain in performance calling the library 
directly. My application do generate a lot of PDFs so I'd like to 
optimiza as possible.


More information about the Digitalmars-d-learn mailing list