https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22417
--- Comment #323 from David Cook <[email protected]> --- Reading through http://erlang.org/pipermail/erlang-questions/2015-September/085799.html took me to https://github.com/erlang/otp/blob/master/erts/lib_src/pthread/ethr_event.c#L65-L161 There are the futex and monotonic time gets I reckon. And maybe the scheduler event loop: https://github.com/erlang/otp/blob/master/erts/emulator/beam/erl_process.c#L3347 I tried adding "+scl false" to see if that would reduce the load generated while waiting, but no change. I'm half tempted to use "+S" to limit the number of schedulers created, which seems equivalent to Go's GOMAXPROCS, but I doubt it's worth fiddling too much. This is a topic that I've encountered when writing my own schedulers and reading about Go's scheduler(s). Unless you sleep, you're going to generate some load, as you're constantly checking if you have work to do. Of course, if you sleep, then you create a chance for latency. Although I think most schedulers check for I/O and timers, and (micro) sleep if there's no I/O, no timer, and no work to do. If you do a strace gainst Apache httpd, you'll see that it's using a select(null, null, null, 1) as an alternative to sleep (like the one mentioned in Perl at https://perldoc.perl.org/functions/select). An alternative to select would be to use epoll (which Erlang does use although with a 0 second timeout), but it seems like Erlang instead does some other work while waiting for work. I'm not an expert on programming language internals especially not ones with focuses on concurrency. Anyway, I don't think RabbitMQ using some system resources is a big drama. -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
