Topic Options
#55977 - 05/16/18 04:36 PM Multithreading Help
NichardRixon Offline
OL Newbie

Registered: 05/16/18
Posts: 6
Greetings OL Community,

I've been looking into multithreading capabilities of our PlanetPress workflow to speed up the whole process. I know about self-replicating processes but I'm not sure if they're what I need here.

We have a workflow process that captures the files in different folders and then sends them to a named printer (Windows Output Queue). We have four printers in use for this process and a different folder for each respective printer which contains the files (PDFs) that we need to print.

As of now in our workflow, it does a capture on one of the folders and then sends the PDFs to the printer, one by one, until all the PDFs have been sent. At that point, it goes to the next part of the workflow, does a folder capture on the next folder and sends to the next printer, etc.

Is there a way that we could somehow multithread the workflow so that we capture the files in one of the folders and send to one of our printers (as one process) and then, while that is still occurring, move on to the next part of the workflow and start the capturing/sending of files to the next printer? Essentially, fork the process and have four unique processes dealing with the sending of files from four folders to four different printers? Self-replicating processes seem useful, but what I want to do, when I reach a certain part of the workflow, is to start multiple processes to deal with different parts of the workflow simultaneously to increase throughput.

Could a self-replicating process fit this need or is there something else I should be looking at? If it is of any use to know, we are running PlanetPress on a Windows 2008 R2 Server as a VM with a one-core processor.

Thanks!
-Kyle

Top
#55978 - 05/16/18 04:42 PM Re: Multithreading Help [Re: NichardRixon]
Jean-Cédric Offline
OL Expert

Registered: 10/03/16
Posts: 481
Loc: Québec, Canada
You could have 4 processes, each looking at a different folder and sending to a different printer. This way they all work simultaneously.

Now at this point, using self-replication would bottle-neck at the printer.

Top
#55979 - 05/16/18 10:11 PM Re: Multithreading Help [Re: NichardRixon]
NichardRixon Offline
OL Newbie

Registered: 05/16/18
Posts: 6
Thanks for the quick reply, JC.

You're referring to four processes that use the event of files being placed in the folders as triggers to start the process, correct?

One thing I should have mentioned is that these PDFs are built on the fly and are placed into these folders through the process of the workflow.

With this in mind, if I had a trigger set to start a separate process based on a PDF being placed in the folder, would a new instance of this process get generated every time a PDF gets placed in the folder?

Another thought I had after reading your comment is to place some dummy text file in a trigger folder AFTER all the PDFs were built for a particular printer, and the process could watch that folder to know when to start the process - after which it could capture all the PDFs that are in a separate folder.

If both of these methods would work, I suppose it just comes down to which one is faster.

Top
#55984 - 05/17/18 10:40 AM Re: Multithreading Help [Re: NichardRixon]
Jean-Cédric Offline
OL Expert

Registered: 10/03/16
Posts: 481
Loc: Québec, Canada
No it would not. Please read Self-replication.

You other idea implies that the input for the process would be a dummy file. Then you would use an Folder Capture as an Action. This will still handle 1 file at the time, in a loop manner, I give you that, but still 1 at the time.

Now as to know which one is faster, it all depends of what you do with these PDF. Do you simply grab them and send them to printers or do you do some other manipulation with them prior to printing?

Top