Re: shmem in backends?

David Mosberger-Tang (David.Mosberger@acm.org)
Tue, 21 Jul 1998 21:28:09 -0700

>>>>> On Tue, 21 Jul 1998 16:53:34 -0400 (EDT), Matto Marjanovic <maddog@mir.com> said:

Matto> Anyhow, threads do seem more apropos than a full-process
Matto> fork, because of the unnecessary bit-slinging overhead you
Matto> incur copying scanner data back to a parent process. (Yeah,
Matto> the scanner head is such a time-limiter it probably doesn't
Matto> matter, but it can't hurt to try to be as efficient as
Matto> possible.)

It will hurt portability and that's painful if there is no significant
gain from it.

Matto> Is there a well-established, portable thread standard that I
Matto> could code with? (Posix threads?) Any suggestions on what
Matto> manpages to start with?

pthreads are standard for POSIX environments nowadays but as I said
above I'd recommend not to use them unless absolutely necessary. For
one thing, SANE runs on platforms as ancient as Apollo DomainOS and I
don't think it's good to break SANE for those older platforms unless
necessary.

What might be a good idea is to abstract the functionality required by
the SANE backends so it can be implemented either using fork() or
threads (much like there are currently platform-dependent versions to
access the SCSI interface). That way, platforms supporing pthreads
and OS/2 could use threads whereas the older platforms would continue
to use fork(). Yuri, is this what your working on?

--david

--
Source code, list archive, and docs: http://www.mostang.com/sane/
To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com