On Monday, January 6, 2014 4:38:48 PM UTC+5:30, Saúl Ibarra Corretgé wrote: > > Hi, > > On 1/5/14 2:46 PM, Ashish wrote: > > > > Hi, > > > > I've these callbacks in my server code that runs on Windows: > > > > *on_read:* after reading from socket > > I assume this is the read callback passed to uv_read_start. > > > *after_worker_thread: *after worker thread ends > > Do you mean the after_work_cb passed to uv_queue_work? > > > *on_keystroke:* after user hits keystroke > > Libuv doesn't have such a callback, what is your application doing to > fire it? > > > > > However, sometimes event loop continuously keep invoking on_read only > > and no other callbacks will be invoked for long time > > (e.g. even if user presses keys or worker thread has ended long time > > back etc.) > > > > This delays critical tasks and results in bad performance, resource > > consumption etc. > > > > Is there any way to address this situation? (e.g. Setting order/priority > > to callbacks etc.?) > > > > There is no way to set priorities to callbacks, they are always fired in > a consistent order: timers, idle, prepare, block for i/o, check, ... > > It's hard to tell what's happening because I know nothing about what > your application is doing. Do you have a libuv-only test case which > behaves incorrectly? > > > Cheers, > > -- > Sa�l Ibarra Corretg� > http://bettercallsaghul.com >
Yes, on_read is the read callback passed to uv_read_start and after_work_cb is passed to uv_queue_work. on_keystroke is callback passed to uv_read again but for tty stream. Sorry I do not have libuv only code at the moment, but it is simple tcp server on Windows. It reads input data (predefined size) from socket and to process that data it fires fixed number of threads using uv_queue_work. Now when I connect to this server using simulator (which simulates thousand connections) and send loads of *asynchronous* data to server, sometimes only on_read gets fired continuously for long time despite worker threads are done with processing for quite a time back, I do not get after_work_cb for any of them, neither do I get tty callback even after keyboard input. -- You received this message because you are subscribed to the Google Groups "libuv" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/libuv. For more options, visit https://groups.google.com/groups/opt_out.
