sane-project-website/old-archive/1999-12/0019.html

84 wiersze
4.1 KiB
HTML

<!-- received="Thu Dec 2 09:02:41 1999 PST" -->
<!-- sent="Thu, 02 Dec 1999 09:10:33 -0800" -->
<!-- name="Brian Macy" -->
<!-- email="bmacy@sunshinecomputing.com" -->
<!-- subject="Re: SANE Net backend suggestion..." -->
<!-- id="" -->
<!-- inreplyto="SANE Net backend suggestion..." -->
<title>sane-devel: Re: SANE Net backend suggestion...</title>
<h1>Re: SANE Net backend suggestion...</h1>
<b>Brian Macy</b> (<a href="mailto:bmacy@sunshinecomputing.com"><i>bmacy@sunshinecomputing.com</i></a>)<br>
<i>Thu, 02 Dec 1999 09:10:33 -0800</i>
<p>
<ul>
<li> <b>Messages sorted by:</b> <a href="date.html#19">[ date ]</a><a href="index.html#19">[ thread ]</a><a href="subject.html#19">[ subject ]</a><a href="author.html#19">[ author ]</a>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="0020.html">Dick Streefland: "[patch] support for Ricoh IS50"</a>
<li> <b>Previous message:</b> <a href="0018.html">Nick Lamb: "Re: SANE Net backend suggestion..."</a>
<!-- nextthread="start" -->
<!-- reply="end" -->
</ul>
<!-- body="start" -->
David Mosberger-Tang wrote:<br>
<i>&gt; </i><br>
<i>&gt; On the down-side, if the scan server doesn't have sufficient disk</i><br>
<i>&gt; space, it could prevent you from scanning altogether. Also, if you do</i><br>
<i>&gt; have a fast link, writing it to the disk could slow things down. I</i><br>
<i>&gt; still think it might be a good idea to do some buffering, but it's</i><br>
<i>&gt; something that needs careful consideration.</i><br>
<p>
Correct... though I have a 100Mbps switched full-duplex network with a<br>
Dual Celeron Linux box with 2 SCSI controllers and my Win2k RC2 Celeron<br>
500 box is having problems keeping up with the scanner greater than<br>
150dpi... go figure, must be a Win2k/hardware issue as my K6-2 350<br>
laptop keeps up.<br>
<p>
Anyways, looked at it last night and it's actually saned.c::do_scan that<br>
would be modified. First thing I plan on doing is changing the logic a<br>
little. Right now it reads data from the scanner only if the output<br>
buffer is completely empty... if the socket isn't ready to send more<br>
data then it just does nothing, even if the buffer isn't full. Though<br>
this makes no difference over the long run performance-wise since you<br>
are always limited by the socket speed... it does mean there are large<br>
delays between sane_read calls... so the time your scanner takes to fill<br>
it's buffer must be greater than the time to transmit the data plus the<br>
a percentage of the time to empty the buffer.<br>
<p>
My though is to...<br>
- First change the code in do_scan to make it read from the scanner if<br>
there is room and the buffer and the socket isn't ready for writing.<br>
This likely will make *zero* difference in the real world but it will at<br>
least make it so the logic makes more sense to me. I'll submit a patch<br>
once I'm reasonably happy with it.<br>
- Second change I see is to add an option to saned to enable file<br>
buffered scanning... that way if you never have a problem with your<br>
remote machines keeping up with the scanning you can use the old method<br>
which will most certainly use fewer resources. I'll submit a patch for<br>
that too. I personally don't have a problem with requiring as much temp<br>
space as the size of the image *if* people want to the intermediate<br>
buffering.<br>
<p>
Thoughts?<br>
<p>
I take it pthreads is not common across all the platforms SANE supports.<br>
I seem to remember vfork being used/wrapped and it does something funky<br>
under OS/2. Anyways, this is doable without threading... though nicer<br>
with it since both scanner and socket IO could be done in parallel.<br>
<p>
Brian Macy<br>
<p>
<pre>
--
Source code, list archive, and docs: <a href="http://www.mostang.com/sane/">http://www.mostang.com/sane/</a>
To unsubscribe: echo unsubscribe sane-devel | mail <a href="mailto:majordomo@mostang.com">majordomo@mostang.com</a>
</pre>
<!-- body="end" -->
<p>
<ul>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="0020.html">Dick Streefland: "[patch] support for Ricoh IS50"</a>
<li> <b>Previous message:</b> <a href="0018.html">Nick Lamb: "Re: SANE Net backend suggestion..."</a>
<!-- nextthread="start" -->
<!-- reply="end" -->
</ul>