smp: add some overview docs on the related minimal example
This commit is contained in:
parent
a9390874c7
commit
ae4897f58a
3 changed files with 15 additions and 0 deletions
BIN
doc-assets/lws-smp-example.png
Normal file
BIN
doc-assets/lws-smp-example.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 91 KiB |
BIN
doc-assets/lws-smp-ov.png
Normal file
BIN
doc-assets/lws-smp-ov.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 71 KiB |
|
@ -1,5 +1,20 @@
|
|||
# lws minimal http server with multithreaded service
|
||||
|
||||
Lws supports multithreaded service... build lws with `-DLWS_MAP_SMP=<max number of threads>`, the
|
||||
default is 1. If nonzero, some extra pthreads locking is built into lws and it supports multiple
|
||||
independent service threads.
|
||||
|
||||

|
||||
|
||||
When an incoming connection is accepted, it is bound to the pt with the lowest current wsi
|
||||
count, to keep the load on the threads balanced. Only the pt the wsi is bound to can service
|
||||
the thread, so although there can be as many wsi being serviced simultaneously as there are
|
||||
service threads, a wsi can only be service by the pt it is bound to.
|
||||
|
||||
The effectiveness of the scalability depends on the load. Here is an example of roughly what can be expected
|
||||
|
||||

|
||||
|
||||
## build
|
||||
|
||||
```
|
||||
|
|
Loading…
Add table
Reference in a new issue