libwebsockets/lib
Andy Green d3a5505542 multithreaded service
This adds support for multithreaded service to lws without adding any
threading or locking code in the library.

At context creation time you can request split the service part of the
context into n service domains, which are load-balanced so that the most
idle one gets the next listen socket accept.

There's a single listen socket on one port still.

User code may then spawn n threads doing n service loops / poll()s
simultaneously.  Locking is only required (I think) in the existing
FD lock callbacks already handled by the pthreads server example,
and that locking takes place in user code.  So the library remains
completely agnostic about the threading / locking scheme.

And by default, it's completely compatible with one service thread
so no changes are required by people uninterested in multithreaded
service.

However for people interested in extremely lightweight mass http[s]/
ws[s] service with minimum provisioning, the library can now do
everything out of the box.

To test it, just try

$ libwebsockets-test-server-pthreads -j 8

where -j controls the number of service threads

Signed-off-by: Andy Green <andy.green@linaro.org>
2016-01-19 20:02:36 +08:00
..
.gitignore Ignoring linux build files 2013-01-09 15:46:11 +08:00
alloc.c Subject: [PATCH] Add custom allocator support using the realloc() interface 2014-12-05 07:25:24 +08:00
base64-decode.c mbed3 warning cleaning 2015-11-14 16:31:01 +08:00
client-handshake.c multithreaded service 2016-01-19 20:02:36 +08:00
client-parser.c multithreaded service 2016-01-19 20:02:36 +08:00
client.c multithreaded service 2016-01-19 20:02:36 +08:00
context.c multithreaded service 2016-01-19 20:02:36 +08:00
daemonize.c clean internal refactor 2015-12-17 17:03:59 +08:00
extension-permessage-deflate.c permessage deflate male callback VISIBLE 2016-01-15 22:16:54 +08:00
extension-permessage-deflate.h extension permessage deflate 2016-01-11 11:34:01 +08:00
extension.c fix broken ext arg parsing 2016-01-19 20:02:34 +08:00
getifaddrs.c whitespace trailing mass cleanout 2015-12-14 08:52:03 +08:00
getifaddrs.h Use LWS_HAVE_ instead of just HAVE_ 2015-10-12 09:53:17 +08:00
handshake.c extension permessage deflate 2016-01-11 11:34:01 +08:00
header.c multithreaded service 2016-01-19 20:02:36 +08:00
hpack.c http header malloc pool implement pool 2015-12-25 14:34:20 +08:00
http2.c extension permessage deflate 2016-01-11 11:34:01 +08:00
huftable.h http2 hpack basic decode ok including huff 2014-10-12 08:38:16 +08:00
lextable-strings.h whitespace trailing mass cleanout 2015-12-14 08:52:03 +08:00
lextable.h Add PATCH, PUT, DELETE methods 2015-01-26 11:25:13 +08:00
libev.c clean libev.c style 2016-01-09 08:13:55 +08:00
libwebsockets.c multithreaded service 2016-01-19 20:02:36 +08:00
libwebsockets.h multithreaded service 2016-01-19 20:02:36 +08:00
lws-plat-mbed3.c clean internal refactor 2015-12-17 17:03:59 +08:00
lws-plat-mbed3.cpp lws_get_context not _ctx 2015-12-17 18:25:25 +08:00
lws-plat-unix.c multithreaded service 2016-01-19 20:02:36 +08:00
lws-plat-win.c multithreaded service 2016-01-19 20:02:36 +08:00
minihuf.c whitespace trailing mass cleanout 2015-12-14 08:52:03 +08:00
minilex.c whitespace trailing mass cleanout 2015-12-14 08:52:03 +08:00
output.c multithreaded service 2016-01-19 20:02:36 +08:00
parsers.c multithreaded service 2016-01-19 20:02:36 +08:00
pollfd.c multithreaded service 2016-01-19 20:02:36 +08:00
private-libwebsockets.h multithreaded service 2016-01-19 20:02:36 +08:00
server-handshake.c multithreaded service 2016-01-19 20:02:36 +08:00
server.c multithreaded service 2016-01-19 20:02:36 +08:00
service.c multithreaded service 2016-01-19 20:02:36 +08:00
sha-1.c clean reduce windows build warnings 2015-12-06 08:00:03 +08:00
ssl-http2.c clean internal refactor 2015-12-17 17:03:59 +08:00
ssl.c multithreaded service 2016-01-19 20:02:36 +08:00