xively / mosquitto

Ruby binding against libmosquitto (http://mosquitto.org/) - a high performance MQTT protocol (http://mqtt.org) client
Other
58 stars 16 forks source link

Fix the threading issue with the Ruby VM #4

Closed methodmissing closed 10 years ago

methodmissing commented 10 years ago

Fix API functions + the interpreter GIL interactions as it crashes the processes non-deterministic for some callbacks. libmosquitto's helper main loop runs in a pthread which the VM isn't aware of. The callbacks to Ruby land run within that thread's context, the VM detects and aborts the process

See http://mosquitto.org/api/files/mosquitto-h.html#mosquitto_loop_start and http://burgestrand.se/articles/asynchronous-callbacks-in-ruby-c-extensions.html