libdill | Structured concurrency in C
kandi X-RAY | libdill Summary
kandi X-RAY | libdill Summary
Structured concurrency in C
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of libdill
libdill Key Features
libdill Examples and Code Snippets
Community Discussions
Trending Discussions on libdill
QUESTION
Does Boost.Fiber automatically yield on network requests (if I understand correctly they yield the CPU during I/O), such as a database call over the network? I want to use it for setting up blocking database calls where I am inserting a lot of information and have a lot of small records that need to be inserted when they are received. My other choice would be libdill/libmill for the microthreading.
The general idea would be:
- receive data
- create fiber and pass it the data
- fiber gets a database connection and sends the INSERT query (libpqxx with postgres)
- other fibers run and can access the database while the database query is in flight
- query returns from database, do error handling and process response
Do fibers work this way as I am envisioning it?
This is the simplified base structure for the code using RapidJSON and boost.fiber, but I'm getting the messages from the network (websocket):
...ANSWER
Answered 2018-Mar-30 at 23:17Does Boost.Fiber automatically yield on network requests (if I understand correctly they yield the CPU during I/O), such as a database call over the network?
No they do not.
What you seem to be looking for would be Boost Coroutines, combined with Boost Asio for the asynchronous IO. They will yield.
There are libraries for database operations that exploit Asio for asynchronous execution (e.g. Amy) or WebSockets (e.g. Boost Beast)
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install libdill
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page