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?
Lock does not block (PDF Converter 2.10h)
Lock does not block (PDF Converter 2.10h)
Don Reid
Computronix
Computronix
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.
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.