List Info

Thread: Neither get_select_fd() nor non-blocking




Neither get_select_fd() nor non-blocking
user name
2006-10-30 07:51:07
I've realized that backends might not provide neither a file
descriptor 
for select() nor non-blocking mode. Why is this allowed? I
guess this 
means that applications, such as xsane, must use a separate
thread or 
process to read the data? IMHO, this puts a lot of
unnecessary burden on 
the application programmer. How common is it with backends
with neither a 
select FD nor non-blocking mode? How about adjusting the
standard so that 
backends must at least support one of these?

Regards, 
-- 
Peter Åstrand		ThinLinc Chief Developer
Cendio AB		http://www.cendio.se
Teknikringen 3
583 30 Linköping	Phone: +46-13-21 46 00-- 
sane-devel mailing list: sane-devellists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/sane-d
evel
Unsubscribe: Send mail with subject "unsubscribe
your_password"
             to sane-devel-requestlists.alioth.debian.org
Neither get_select_fd() nor non-blocking
user name
2006-10-30 15:05:52
astrand- sorry if you get this twice...

On Mon, 30 Oct 2006 astrandcendio.se wrote:

>
> I've realized that backends might not provide neither a
file descriptor
> for select() nor non-blocking mode. Why is this
allowed? I guess this
> means that applications, such as xsane, must use a
separate thread or
> process to read the data? IMHO, this puts a lot of
unnecessary burden on
> the application programmer. How common is it with
backends with neither a
> select FD nor non-blocking mode? How about adjusting
the standard so that
> backends must at least support one of these?
>

my personal opinion only:

there are plenty of front-ends for which non-blocking mode
is not required
(think command line, or cgi script, etc). all of my
front-ends work this
way. if each backend (there are 68+ of them) has both a
blocking and a
non-blocking mode, that is quite a bit of code. it is also
significantly
more difficult to debug the backend when it is
multi-threaded. given that
many of our backends are rarely touched or are maintained by
someone other
than the original author, it makes sense to keep them
simple.

besides, its easier for app developer (who likely has
multi-threading in 
his app already for other purposes) to decide that he needs
it, and deal 
with the threading himself.

the fujitsu backend no longer has threading for this reason.

allan

-- 
"so don't tell us it can't be done, putting down what
you don't know.
money isn't our god, integrity will free our souls" -
Max Cavalera

-- 
sane-devel mailing list: sane-devellists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/sane-d
evel
Unsubscribe: Send mail with subject "unsubscribe
your_password"
             to sane-devel-requestlists.alioth.debian.org
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )