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 From an...@pfeiffer.edu Mon Oct 30 16:05:52 2006 From: an...@pfeiffer.edu (m. allan noah) Date: Mon Oct 30 16:13:20 2006 Subject: [sane-devel] Neither get_select_fd() nor non-blocking In-Reply-To: <pine.lnx.4.64.0610300842180.7...@maggie.lkpg.cendio.se> References: <pine.lnx.4.64.0610300842180.7...@maggie.lkpg.cendio.se> Message-ID: <pine.lnx.4.61.0610301004370.16...@limos.pfeiffer.edu> astrand- sorry if you get this twice... On Mon, 30 Oct 2006 astr...@cendio.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