4 ms·
I'm curious about the differences mentioned in the threading section, "In nanomsg the objects are not tightly bound to particular threads and thus these problem
by clarkevans 13y ago
I'm curious about the differences mentioned in the threading section, "In nanomsg the objects are not tightly bound to particular threads and thus these problems don't exist."
Does this mean that threading is still used/required, or could nanomsg use non-blocking techniques?
- rumcajz 13y agoThreading is required as there's processing going in the background. Not sure what you mean by non-blocking techniques. Lock-free algorithms maybe? These are used in ZeroMQ as well.
- JulianMorrison 13y agoThey probably mean async/evented techniques. For example, provide a function to get a FD that select()s as readable when stuff needs background processing, and a do_background_step() method to call, so it can be hooked into a single threaded event loop.
- rumcajz 13y agoYuck. Why would anyone want that kind of stuff. nanomsg does all its processing in the background threads, same way as TCP does. I doubt anyone would ask to have to call do_background_processing_step() to make TCP work. Also, that kind of thing compromises internal working of the library, if the user doesn't call do_background_step() fast enough. Timers may be delayed that way etc.