New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
parallel backend causes high CPU load #2056
Comments
CUPS.org User: mike Actually, we don't want to do it this way, but instead keep track of the open mode so that we can support bidi whenever possible. I'll post a new patch that does this later today... |
CUPS.org User: mike The attached patch should do the right thing... Let me know if you still have problems.. |
CUPS.org User: twaugh.redhat It fixes the high CPU load, but unfortunately Linux seems to do this: select(5, [0 4], [], NULL, NULL) = 2 (in [0 4]) i.e. select() says it's available for reading but read() blocks. I think it might be best to set use_bc=0 for Linux in the parallel backend. |
CUPS.org User: mike Sigh... Please report this as a bug upstream to the kernel developers? Thanks! For now we'll just disable the O_RDWR open on Linux; other platforms don't have this problem... |
"cups-parallel-busy-loop.patch": --- cups-1.2.5/backend/parallel.c.parallel-busy-loop 2006-10-26 14:46:38.000000000 +0100
if (print_fd != 0 && tbytes >= 0) |
"str2056.patch": Index: parallel.c--- parallel.c (revision 6063)
if (print_fd != 0 && tbytes >= 0) |
Version: 1.2.5
CUPS.org User: twaugh.redhat
The parallel backend opens the device node with O_WRONLY, but then calls backendRunLoop with use_bc=1, causing it to try reading from the file descriptor. Of course this fails, but unfortunately it can produce busy-looping when the printer is off or busy.
Fix attached.
The text was updated successfully, but these errors were encountered: