Subject: Re: "knowing" when a file is available in a directory
To: None <firstname.lastname@example.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
Date: 10/06/1999 15:10:14
>> How quickly do you need detect the new file? you could poll once a
>> second for a change in modification time on the directory. On a
>> local filesystem it shouldn't be too painful..
> As things are, the printer will outrun any single CPU computer by a
> fair margin, so any idle time on the computer is categorically a bad
Not if there are no jobs queued. :-)
> Also, polling on a one second interval would limit the printer to (an
> upper bound of) 60 print jobs a minute, which would be too slow.
Not if you can handle more than one job per poll. (What, you have a
Alternatively, you could poll immediately after completion of a job and
fall back to interval-based polling only if a poll shows nothing queued.
> [...] I'd probably get better performance by getting the receiving
> process to somehow cooperate.
If you have control over the process that's dropping these things in
the queue, yes, I'd say you probably would be better off having it do
something like sendto() an AF_LOCAL socket to kick the daemon, or read
a PID from a file and send a signal, or something.
7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B