Print Page | Close Window

Multithreading

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=2241
Printed Date: 20 May 25 at 6:20AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Multithreading
Posted By: alecd4
Subject: Multithreading
Date Posted: 21 Apr 12 at 10:47PM
If this library tread safe? I am using the library in a windows service (C#) where I can have multiple threads that create/update pdf documents. 

Don't see any problems so far. Should I expect any?



Replies:
Posted By: AndrewC
Date Posted: 26 Apr 12 at 1:14PM

Running QPL in a service could be a problem because we use GDI+ for many PDF functions.

From  http://msdn.microsoft.com/en-us/library/ms533798%28v=vs.85%29.aspx - http://msdn.microsoft.com/en-us/library/ms533798(v=vs.85).aspx

"GDI+ functions and classes are not supported for use within a Windows service. Attempting to use these functions and classes from a Windows service may produce unexpected problems, such as diminished service performance and run-time exceptions or errors."


Posted By: Wheeley
Date Posted: 26 Apr 12 at 11:32PM
Do you have a list of these functions? My company is using it in a service and so far we have not had any problems. But I'd like to very for sure we wouldn't.

Wheeley


Posted By: AndrewC
Date Posted: 30 Apr 12 at 3:24PM
We haven't done any testing with using QPL in a Windows Service.

The GDI+ function calls in QPL are used for the Rendering and Printing functions.  

Wheeley -  Which QPL calls do you currently use in your Windows Service ?  This might help us and others work out which functions, if any, are unsafe to use in a Windows Service ?


Posted By: AndrewC
Date Posted: 30 Apr 12 at 4:09PM
Also, we have recently completed more extensive testing on the library for thread safety and have found a few small problems that have been fixed in the 8.15 release and there are further fixes coming for the 8.16 beta 1 release.

If each thread uses a new instance of QuickPDF Library then it should work pretty well when using 8.15 or 8.16 versions of QPL.


Posted By: Wheeley
Date Posted: 30 Apr 12 at 11:49PM
We use the following when running in a service:

AddToFileList
AnalyseFile
ClearFileList
CompressContent
CreateLibrary
Decrypt
DecryptFile
DeleteAnalysis
DocumentCount
EncodePermissions
EncryptFile
EncryptionStatus
FileListItem
GetAnalysisInfo
GetDocumentID
LastErrorCode
LibraryVersion
LoadFromFile
MergeFileListFast
NewDocument
NewOutline
PageCount
PrintDocument
PrintOptions
RemoveDocument
SaveToFile
SelectDocument
SelectPage
SetPageLayout
SetPageMode
SetTempFile
SetTempPath
SignFile
TestTempPath
Unlock
UnlockKey


Wheeley


Posted By: AndrewC
Date Posted: 02 May 12 at 3:38PM
Wheely,

PrintDocument uses the GDI+ functions to render the document for printing.  If it is working correctly for you then it seems Microsoft might are just being over cautious.  Not of the other functions you use would require GDI+.

Andrew.


Posted By: Wheeley
Date Posted: 02 May 12 at 8:42PM
The catch with the function using GDI+ is how you run your service. Microsoft might indeed be correct when you run the service using "Local Administrator". Because of other issues we require our service to run using a named user. So more investigation is needed by all.

Wheeley



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk