Lock does not block (PDF Converter 2.10h)

The Amyuni PDF Converter is our Printer Driver that enables you to convert any documents to PDF format. If you have any questions about installing and using the Amyuni PDF Converter please post them here.
Post Reply
dreid
Posts: 1
Joined: Mon Mar 15 2004

Lock does not block (PDF Converter 2.10h)

Post by dreid »

I'm doing some stress testing and have started two processes.

In the first process I call Lock with szLockName = "TestA.pdf" and then wait forever. I can see that it successfully creates the entries under the HKCC\Software\printername\Locks\DOC_TestA.pdf registry entry.

In the second process, I call Lock with the same szLockName. It checks the registry key a number of times (for approx 5 seconds) and then returns with a RC=-1 and the GetLastErrorMsg function returns "The operation completed successfully."

How do I get Lock to properly block?
Don Reid
Computronix
Dany
Amyuni Team
Posts: 113
Joined: Wed Sep 11 2002
Location: Montreal.
Contact:

Post by Dany »

Lock should lock the process only for a few microseconds needed for the process to start printing. There's no need to wait for the first process to end printing before the second process starts.

A conflict typically occurs in the following situation:
Process A sets the output file name and file name options
Process B sets the output file name and file name options
Pcocess A starts printing
Pcocess B starts printing

To resolve this conflict:
A typical procedure would be as follows:
Process A calls Lock
Process A sets the output file name and file name options
Process B calls Lock --> Process B is put on hold until the next step
Process A starts printing --> This removes the Lock to allow process B to proceed
Process B sets the output file name and file name options
Pcocess B starts printing

In short, the delay between calling Lock and starting to print should not be longer than 5 seconds.
Post Reply