On Monday, October 12, 2015 at 1:59:59 AM UTC-4, Yakir Gagnon wrote: 
>
> One important piece of information is the integration time (similar to the 
> shutter speed in a camera): after I set the integration time the 
> spectrometer start sampling the spectra at that frequency. When I try to 
> retrieve the intensities it will spit them out only when one cycle ends. 
> This means that when I try to run the function that retrieves the 
> intensities it can take anything from 0 to integration-time seconds. 
>
> Here's the weird thing: 
> When I run my code the REPL becomes non-responsive for integration-time 
> seconds, so if I try to type some text, the letters get typed in only one 
> letter at an integration-time (note that CPU usage is less than 3%)... But, 
> if I replace the function that retrieves the intensities with some mock 
> function that `sleep`s for a random amount of time and returns a (equally 
> long) vector of random floats, the REPL jitter is gone..! 
>

Julia I/O functions, and functions like sleep(t), use the libuv library for 
asynchronous cooperative multitasking.  That means that when one task is 
waiting on I/O, another task (e.g. the REPL) can wake up if there is 
something for it to do.

However, Python I/O does not use libuv, so when the Python I/O task is 
waiting to finish reading something then it just blocks, and nothing else 
in Julia can run.

Reply via email to