You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To make it easier to do database connection pooling in my app, I've created
this patch to expand the callback functions so that they provide calls when
each worker thread starts and stops. This should not cause any added overhead
since the number of worker threads is static.
The comments in the mongoose.h should be self-explanatory.
Events added: MG_ENTER_THREAD, MG_EXIT_THREAD (These events receive unusual 2nd
and 3rd parameters. Since there is no socket connection when they are called,
the 2nd parameter is replaced by the void *user_data originally passed to
mg_start().)
Structures modified: mg_request_info -> added void* thread_ctx
Functions modified: worker_thread()
Tested only on Windows, with Visual Studio 6.
Original issue reported on code.google.com by [email protected] on 17 Apr 2012 at 5:34
This could actually also be used to set the priorities of the worker threads to
a value that is appropriate for the individual system - together with a similar
event for the master thread.
I considered adding a master thread hook when I was making the patch but I
don't have a need for it and I try to follow the "You Won't Need It" principle
whenever possible. Now if there is a need, I could add it. Probably would use
MG_ENTER_MASTER and MG_EXIT_MASTER as the event IDs to make things simple.
Original issue reported on code.google.com by
[email protected]
on 17 Apr 2012 at 5:34Attachments:
The text was updated successfully, but these errors were encountered: