sane-project-website/old-archive/1999-02/0186.html

77 wiersze
3.7 KiB
HTML

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

<!-- received="Fri Feb 26 07:07:43 1999 PST" -->
<!-- sent="Fri, 26 Feb 1999 17:06:29 +0200" -->
<!-- name="Milon Firikis" -->
<!-- email="milonf@ariadne-t.gr" -->
<!-- subject="Re: Porting SANE backends" -->
<!-- id="" -->
<!-- inreplyto="Porting SANE backends" -->
<title>sane-devel: Re: Porting SANE backends</title>
<h1>Re: Porting SANE backends</h1>
<b>Milon Firikis</b> (<a href="mailto:milonf@ariadne-t.gr"><i>milonf@ariadne-t.gr</i></a>)<br>
<i>Fri, 26 Feb 1999 17:06:29 +0200</i>
<p>
<ul>
<li> <b>Messages sorted by:</b> <a href="date.html#186">[ date ]</a><a href="index.html#186">[ thread ]</a><a href="subject.html#186">[ subject ]</a><a href="author.html#186">[ author ]</a>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="0187.html">Matt Mozur: "Re: UMAX Astra 1200S lamp question"</a>
<li> <b>Previous message:</b> <a href="0185.html">Svend Daugaard Pedersen: "Re: Porting SANE backends"</a>
<li> <b>Maybe in reply to:</b> <a href="0178.html">Svend Daugaard Pedersen: "Porting SANE backends"</a>
<!-- nextthread="start" -->
<li> <b>Next in thread:</b> <a href="0190.html">Oliver Rauch: "Re: Porting SANE backends"</a>
<!-- reply="end" -->
</ul>
<!-- body="start" -->
Oliver Rauch wrote:<br>
<i>&gt; </i><br>
<i>&gt; Svend Daugaard Pedersen wrote:</i><br>
<i>&gt; </i><br>
<i>&gt; &gt; - don't use 'alloca()'</i><br>
<i>&gt; &gt; this routine is not an ANSI routine and it is difficult</i><br>
<i>&gt; &gt; (in many cases impossible) to implement in a C system not</i><br>
<i>&gt; &gt; having it.</i><br>
<i>&gt; &gt;</i><br>
<i>&gt; </i><br>
<i>&gt; Thats no problem, changed it in the umax backend.</i><br>
<i>&gt; </i><br>
<i>&gt; &gt; - don't use 'fork()' and related routines</i><br>
<i>&gt; &gt; if you feel it is necessary, do it in a way that makes it</i><br>
<i>&gt; &gt; easy to change the code (snapscan.c is a good example) or</i><br>
<i>&gt; &gt; better: make this part of the code conditional.</i><br>
<i>&gt; &gt;</i><br>
<i>&gt; </i><br>
<i>&gt; What is the problem with fork. The amiga has a multi-tasking system, soI don`t</i><br>
<i>&gt; understand the problem.</i><br>
<p>
Well win32 is also a multitasking system (sort of) but it does not have<br>
fork(). What I want to say is that fork() is defined bu Unix and Posix<br>
implementations but it is not a LibC or an ANSI C routine such as<br>
malloc. The only reason that this (kernel) function is being used in<br>
backends is to prevent the blocking of the frontend application during<br>
the sanei_scsi_read. AFAIK fork() has already give some problems with<br>
the OS/2 port where the fork() is very expensive.<br>
<p>
The proper way to resolve this is to make a wrapper much like the way<br>
sanei_scsi_* routines work. This way when somebody wants to port SANE in<br>
a new platform he should code only the implementation around the wrapper<br>
which is system dependent. I should say it again that the sanei_scsi*<br>
routines are the perfect example of an analogous implementation.<br>
<p>
MF<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="0187.html">Matt Mozur: "Re: UMAX Astra 1200S lamp question"</a>
<li> <b>Previous message:</b> <a href="0185.html">Svend Daugaard Pedersen: "Re: Porting SANE backends"</a>
<li> <b>Maybe in reply to:</b> <a href="0178.html">Svend Daugaard Pedersen: "Porting SANE backends"</a>
<!-- nextthread="start" -->
<li> <b>Next in thread:</b> <a href="0190.html">Oliver Rauch: "Re: Porting SANE backends"</a>
<!-- reply="end" -->
</ul>