-
Notifications
You must be signed in to change notification settings - Fork 160
How to use multithreading #146
Comments
Yes even i am facing the same issue. it runs perfectly with JMeter request but not with browser request if asked multiple, threadpool is not working as expected |
You can create both of base and evhtp for each thread. Then Listen a socket and every socket can bind the socket. Or you can create sockets as reuseport for a port |
@tturbs void read_cb(...){
// If this is a read callback
// and use sleep 1 minute.
} I cannot get a new client connection when the minute. |
This should work, until you have threads that do not perform you long running callback. |
The problem, as far as my limited experience allows me to see, is that a thread is not considered busy if there are no "messages" from the main thread in its queue. The scheduler tries to use a thread that has no messages waiting, starting with the lowest numbered thread. Unfortunately, if a thread is busy processing a request and no other messages are in its backlog, the same thread is scheduled again.
|
about long-term tasks
I want to use multithreading, but it doesn't work all the time. How can I continue to monitor other client connections when doing long-term tasks.
What should I do?
Example code (if applicable)
master
e200bfa
The text was updated successfully, but these errors were encountered: