Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: splwow64.exe printer service slowing program using TPrinter()


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 0
Richard Williams

Posts: 23
Registered: 6/4/05
splwow64.exe printer service slowing program using TPrinter()  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 10, 2016 1:13 AM
First the explanation of my problem with a little background, then the questions.

Explanation:
I have a little program that converts images to floss colours for cross stitch purposes, and the main product is a printed chart for people to stitch from, so I have added the <printers.hpp> header to the main form.
On 64 bit machines the windows service activated is splwow64.exe, and this seems to handle the 32bit-64bit print spooler interface. And this seems to be the biggest factor in slowing down the program, reducing the program thread to 75% inactivity. This is a bit of a problem.

When doing the thread colour selection process (which is done in a separate form without the '#include <printers.hpp>' line), each pixels is checked against about 12000 possible floss colours to find the closest RGB components. It takes an appreciable time, up to a couple of minutes on a fast machine and 25 on a slow one, and watching the Windows task manager peak at 25% activity on one processor core is galling, particularly when all it's doing is waiting for a windows service it doesn't need at that point.

I cannot multi thread the process, as the image is dithered as it is converted, and synchronising the dither patterns is beyond my ability at the moment. However, I could do the floss colour selection in a single TThread separate from the program thread.

I am using C++Builder 10.1 Starter, so the only option is a 32 bit program.

Questions
1) Does anyone know of a way to force splwow64 to respond more quickly?
2) Is it likely that, if the floss colour selection process were in a new TThread, would the new TThread be affected by splwow's waiting time? Creating a new TThread with the analysis in it would take a fair heap of time & I would prefer to hear from others whether this is likely to be effective before trying.
3) Could I shorten the whole process of creating the new TThread by putting the creation of the floss selection form in the new thread execution method as opposed to it being created by the main program window?

Thanks in advance,

Regards

Richard.

Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02