[sane-devel] Compiling sane-backends CVS 2003/10/22 on OS/2

Henning Meier-Geinitz henning at meier-geinitz.de
Wed Oct 29 16:30:11 GMT 2003


Hi,

On Wed, Oct 29, 2003 at 05:15:52PM +0100, Gerhard Jaeger wrote:
> > At least on Linux, it does not work perfectly (cancelling leads to segfaults
> > sometimes).

The segafults appear to happen after exiting xsane only so it's not
that bad.

> As I stated in my former mails, when using pthreads and the canceling
> mechanism, one should in general try and let the thread die gracefully.
> Which leads to some command exchange mechanism i.e.
> The "cancel"-command sets a variable, that will be checked by the 
> reader thread. If detected active, the reader thread stops its acitivity
> and exists. Doing this the hard-way via pthread_cancel it might be, that
> you run into trouble.
> One thing you can test is:
> comment out the line with pthread_setcanceltype (should be 201), recompile
> and check if the segfault behaviour is better...

Thanks. When there is more time I'll try.

I think there is trouble with cancelling the SCSI commands while using
threads but I'm not sure yet.

Bye,
  Henning




More information about the sane-devel mailing list