Closed GoogleCodeExporter closed 9 years ago
Original comment by valenok
on 5 Mar 2009 at 8:41
Part 1 is implemented (to be ported on Windows still)
Part 2 (pthread join) is started.
Original comment by valenok
on 23 Mar 2009 at 7:12
Very nice! Thank you.
Original comment by caleb.ep...@gmail.com
on 24 Mar 2009 at 2:51
Completed part (2).
Now, windows port left.
Original comment by valenok
on 24 Mar 2009 at 3:50
This almost does it. mg_stop doesn't do anything to wait for the
listening_loop to
complete. I'd suggest waiting for that thread and only then calling mg_fini
from the
thread that called mg_stop.
Original comment by caleb.ep...@gmail.com
on 24 Mar 2009 at 4:12
The way it works now is that mg_stop() only sets a flag and returns. Master
thread
exits its loop, and calls mg_fini(), which waits until all threads finish. I
don't
think that mg_stop() should block, since waiting could be long.
Original comment by valenok
on 24 Mar 2009 at 4:18
Perhaps an mg_wait() function that does both then? When I'm embedding my own
code
into mongoose, I need to know the server has fully stopped before I can safely
release my own resources...
Original comment by caleb.ep...@gmail.com
on 24 Mar 2009 at 5:03
Maybe a boolean flag to mg_stop() is sufficient, "to wait or not to wait" (c) ?
Original comment by valenok
on 24 Mar 2009 at 5:41
Perfect.
Original comment by caleb.ep...@gmail.com
on 24 Mar 2009 at 5:42
After some thinking and experimenting, I decided to leave the API unchanged.
mg_stop() now blocks unconditionally until all Mongoose threads exit.
Original comment by valenok
on 25 Mar 2009 at 11:34
Windows port completed.
Closing this issue.
Original comment by valenok
on 25 Mar 2009 at 8:40
In the latest mongoose, the "pool of threads" behavior seems to have gone away
and I
get a new thread to handle every request. Is this intentional?
Original comment by caleb.ep...@gmail.com
on 19 Jun 2009 at 5:33
No, this was a breakage.
SVN head has thread pool functionality fixed. You can either update to head, or
wait
until 2.7 which will be released soon.
Original comment by valenok
on 5 Jul 2009 at 7:50
Original issue reported on code.google.com by
caleb.ep...@gmail.com
on 5 Mar 2009 at 8:27