Giter VIP home page Giter VIP logo

Comments (3)

ap-- avatar ap-- commented on July 22, 2024

Please create a minimal example that reproduces the error.

It looks like you are opening the Spectrometers in the main process and then try to retrieve the intensities from different subprocesses. My guess is that if you move the instantiation of the spectrometer objects to the individual subprocesses it might work. But no guarantees. I am not sure if pyUSB is the limiting factor here.

from python-seabreeze.

Fi156 avatar Fi156 commented on July 22, 2024

Thank you for your quick response!

I have tried to reduce the example to a minimum. But still multiprocessing and sensor initialization are adding some necessary lines of code here - sorry!

http://pastebin.com/XYC3gwDb

Yes, I am opening the Spectrometers and loading these into a list (Line 42).

I tried to put the whole initialisation code into the subprocess part, afterwards even longer sleep commands are needed, because otherwise I get an error "USB device busy".

move the instantiation of the spectrometer objects to the individual subprocesses

Or which part should I move into the subprocess?

from python-seabreeze.

ap-- avatar ap-- commented on July 22, 2024

Hey there,
I'm cleaning up a few older issues. Sorry I never got back to you on this one 🙇 😞

  • Seabreeze is not multiprocessing safe nor even thread safe.
  • Spectrometers should be initialised in their own processes.
  • I would not try to pass spectrometer instances via pickling to other processes.
    In its current state, that is basically calling for a disaster to happen 😅
  • I would double check that class decorators don't interfere with the pyseabreeze metaclass usage.

All those comments should have been here 4 years ago. Sorry again 🙇

Cheers,
Andreas

from python-seabreeze.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.