Disable multi-threading mutex in single threaded mode
Closed this issue · 1 comments
kenba commented
A part of the fix for issue #11 was to add mutexes to server
and http_server
to protect 'connections_' and http_connections_
respectively during concurrent access.
The mutexes provided a quick and simple solution to the issue but std::mutex
is notoriously slow.
The connections_mutex_
and http_connections_mutex_
should not be locked when use_strand == false
.
kenba commented
Tested in single and multi-threaded modes using Apache benchmark on a separate machine running the following:
ab -n 10000 -c 1000 -k 192.168.1.64:80/hello
The servers ran correctly without any errors.
The documentation has been updated to add a separate Configuration file.
The new release is tagged 1.3.1
.