Boost does not provide single-threaded event-driven model, such that was widespread on Unix before pthreads -- mainloop + "callbacks", does it ?
For example, if I wanted to use boost::message_queue in single-threaded app, and mix it with timers and other asynchronous events (mainloop), then boost does not support it, am I right ?
js is a single-threaded but highly scalable system that utilizes JavaScript as its scripting language. It uses asynchronous, event-driven I/O instead of separate processes or threads.
Event-driven architecture makes the server highly scalable and it does not wait for an API to return data, it moves to the next API immediately for the next request. Non-blocking operation means the server will not block itself for one request.
JavaScript has a runtime model based on an event loop, which is responsible for executing the code, collecting and processing events, and executing queued sub-tasks. This model is quite different from models in other languages like C and Java.
I'd look at
If you are going to combine the two, be sure to use Boost Signals2 (because it supports threading).
boost::interprocess::message_queue
is designed for multiprocessing. In a single-threaded process you can always use an std::queue
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With