Date: Tue, 2 May 2000 19:55:40 +0200 From: "Lorenzo Iania" <l.iania@sintesi.net> To: <freebsd-hackers@freebsd.org> Subject: Re: lpr: order of print requests Message-ID: <001401bfb45f$a16978c0$0500000a@sintesi.intr>
next in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
I don't know if I make any strange mistake, but I have done the following simple thing.
File p.c :
#include <stdio.h>
FILE *fp ;
main()
{
register int i ;
for (i=0;i<1000;i++)
{
fp=popen("lpr -Plp","w");
fprintf(fp,"Richiesta N. %d\n",i);
pclose(fp);
}
}
then
cc -o p p.c
./p
the result of lpq after this is:
waiting for lp to become ready (offline?)
Rank Owner Job Files Total Size
1st root 33 (standard input) 15 bytes
2nd root 30 (standard input) 15 bytes
3rd root 35 (standard input) 15 bytes
4th root 36 (standard input) 15 bytes
5th root 29 (standard input) 15 bytes
6th root 31 (standard input) 15 bytes
7th root 37 (standard input) 15 bytes
8th root 38 (standard input) 15 bytes
9th root 39 (standard input) 16 bytes
10th root 40 (standard input) 16 bytes
11th root 41 (standard input) 16 bytes
12th root 42 (standard input) 16 bytes
13th root 32 (standard input) 15 bytes
14th root 34 (standard input) 15 bytes
15th root 56 (standard input) 16 bytes
16th root 57 (standard input) 16 bytes
17th root 43 (standard input) 16 bytes
....etc
As you can see, the first on the queue is Job 33, while the second is 30 and so on ....
The sizes are irrilevant because they are the same.
For this reason, and for similar problems, it is desiderable that the order of the requests is the same. I think that must be a chance to respect the order of the requests to avoid situations like this.
Thanks.
[-- Attachment #2 --]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=windows-1252" http-equiv=Content-Type>
<META content="MSHTML 5.00.2919.6307" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>I don't know if I make any strange mistake, but I
have done the following simple thing.</FONT></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>File p.c :</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>#include <stdio.h></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>FILE
*fp
;</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>main()<BR>{<BR>register int
i ;</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>for
(i=0;i<1000;i++)<BR>
{<BR> fp=popen("lpr
-Plp","w");<BR> fprintf(fp,"Richiesta
N. %d\n",i);<BR>
pclose(fp);<BR>
}<BR>}<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>then</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>cc -o p p.c</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>./p</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>the result of lpq after this is:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>waiting for lp to become ready
(offline?)<BR>Rank Owner Job
Files
Total Size<BR>1st root
33 (standard
input)
15 bytes<BR>2nd root
30 (standard
input)
15 bytes<BR>3rd root
35 (standard
input)
15 bytes<BR>4th root
36 (standard
input)
15 bytes<BR>5th root
29 (standard
input)
15 bytes<BR>6th root
31 (standard
input)
15 bytes<BR>7th root
37 (standard
input)
15 bytes<BR>8th root
38 (standard
input)
15 bytes<BR>9th root
39 (standard
input)
16 bytes<BR>10th root
40 (standard
input)
16 bytes<BR>11th root
41 (standard
input)
16 bytes<BR>12th root
42 (standard
input)
16 bytes<BR>13th root
32 (standard
input)
15 bytes<BR>14th root
34 (standard
input)
15 bytes<BR>15th root
56 (standard
input)
16 bytes<BR>16th root
57 (standard
input)
16 bytes<BR>17th root
43 (standard
input)
16 bytes<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>....etc</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>As you can see, the first on the queue is Job 33,
while the second is 30 and so on ....</FONT></DIV>
<DIV><FONT face=Arial size=2>The sizes are irrilevant because they are the
same.</FONT></DIV>
<DIV><FONT face=Arial size=2>For this reason, and for similar problems, it is
desiderable that the order of the requests is the same. I think that must be a
chance to respect the order of the requests to avoid situations like
this.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks.</DIV></FONT>
<DIV> </DIV>
<DIV> </DIV></BODY></HTML>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?001401bfb45f$a16978c0$0500000a>
