[sane-devel] pthreads for MacOSX (instead of child process)

Hubert Figuiere hfiguiere at teaser.fr
Fri Feb 14 13:21:27 GMT 2003


On samedi, fév 8, 2003, at 19:41 Europe/Paris, abel deuring wrote:

[ snipped useless-and-out-of-topic rant ]

> I also had a short look into Apple's mailing list archives. The 
> answers to a question by Beat regarding device access from forked 
> processes seem to indicate there is really not hope. The main reason 
> seems to be "too complicated to implement for Mach". (BTW, the 
> archives of older mailings are the worst organized archives I have 
> seen since a long time. So much for the shiny surface of Apple 
> stuff...)

[...]
> Somebody proposed to the apple mailing list to start a sort of a 
> daemon which accesses the device. Since sockets (pipes too?) seem to 
> survive a fork on macos, this could indeed be a way to avoid the 
> current fork hassles. Other ways would be to provide a non-forking 
> version of the backend (like the Sharp and NEC backends do), or to 
> make the backends thread-safe (should not be that much work, since the 
> tasks of the two processes/threads are different enough), and to 
> expand the sanei_thread library.

I'm not really an IOKit expert, but perhaps should one write a generic 
device driver for USB that just create proper device entries.

I suggest emulating *BSD USB behaviour. That way, we then would need to 
change libusb to use *BSD code and we would have a better 
compatibility. IOKit use as its advantage, like allowing USB access in 
userland, but the mach_port problem is not a simple issue.

Just a thought, I'll dig further to see what can be done (not sure I'll 
have the time to actually code anything)


Hub
-- 
Hubert Figuière - http://www.figuiere.net/hub/
Cell-phone: +33 6 18 01 42 11 - iChat/AIM: hfiguiere
Any HTML e-mail sent to me will be discarded.




More information about the sane-devel mailing list