Skip to content

Can i run mg_mgr_poll in the main thread and not be blocked ? #2147

Discussion options

You must be logged in to vote

I don't have the slightest idea of what Unreal Engine is.
Mongoose select()s or poll()s waiting for data or timeout (user defined, so...). If you run another stuff in the same loop, it must be non-blocking and will be delayed by Mongoose's own blocking (timeout).
If you need to communicate with other threads you can use its internal queue (latest) or its back-to-back socket connection (to be deprecated in the future) (or a queue, or shared variables, or OS messages, or whatever)
https://github.com/cesanta/mongoose/tree/master/examples/multi-threaded (the example shows using Mongoose internal lock-free queue)
https://mongoose.ws/documentation/tutorials/multi-threaded/ (the tutorial covers …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by scaprile
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants