libwebsockets/doc-assets/threadpool.svg
2018-09-11 18:27:59 +08:00

3 lines
15 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<svg width="117.73mm" height="119.98mm" version="1.1" viewBox="0 0 117.72776 119.97711" xmlns="http://www.w3.org/2000/svg"><defs><marker id="b" overflow="visible" orient="auto"><path transform="matrix(-.2 0 0 -.2 -1.2 0)" d="m0 0 5-5-17.5 5 17.5 5z" fill-rule="evenodd" stroke="#000" stroke-width="1pt"/></marker><marker id="c" overflow="visible" orient="auto"><path transform="matrix(-.2 0 0 -.2 -1.2 0)" d="m0 0 5-5-17.5 5 17.5 5z" fill-rule="evenodd" stroke="#000" stroke-width="1pt"/></marker><marker id="a" overflow="visible" orient="auto"><path transform="matrix(-.2 0 0 -.2 -1.2 0)" d="m0 0 5-5-17.5 5 17.5 5z" fill-rule="evenodd" stroke="#000" stroke-width="1pt"/></marker><filter id="d" x="-.052144" y="-.051067" width="1.1043" height="1.1021" color-interpolation-filters="sRGB"><feGaussianBlur stdDeviation="2.3162866"/></filter></defs><g transform="translate(483.61 -108.01)"><g><rect x="-478.05" y="113.57" width="106.61" height="108.86" filter="url(#d)"/><rect x="-480.29" y="111.33" width="106.61" height="108.86" fill="#f9f9f9"/><rect x="-432.75" y="145.67" width="45.287" height="17.581" fill="#f00" opacity=".497" stroke="#18161a" stroke-linejoin="round" stroke-width=".12217"/><rect x="-432.85" y="168.43" width="45.212" height="45.685" fill="#00f" opacity=".497" stroke="#18161a" stroke-linejoin="round" stroke-width=".19677"/></g><g fill="#e7e0e6" stroke="#18161a" stroke-linejoin="round" stroke-width=".060447"><rect x="-431.73" y="146.79" width="43.364" height="4.4949" opacity=".497"/><rect x="-431.79" y="152.38" width="43.364" height="4.4949" opacity=".497"/><rect x="-431.89" y="169.63" width="43.364" height="4.4949" opacity=".497"/><rect x="-431.96" y="175.21" width="43.364" height="4.4949" opacity=".497"/><rect x="-432.02" y="180.87" width="43.364" height="4.4949" opacity=".497"/><rect x="-432.09" y="186.45" width="43.364" height="4.4949" opacity=".497"/><rect x="-432.16" y="191.85" width="43.364" height="4.4949" opacity=".497"/><rect x="-432.22" y="197.43" width="43.364" height="4.4949" opacity=".497"/><rect x="-431.79" y="157.73" width="43.364" height="4.4949" opacity=".497"/><rect x="-432.29" y="202.83" width="43.364" height="4.4949" opacity=".497"/><rect x="-432.35" y="208.41" width="43.364" height="4.4949" opacity=".497"/></g><text x="-425.05948" y="144.5038" fill="#000000" font-family="'Open Sans'" font-size="2.1167px" letter-spacing="0px" stroke-width=".26458" text-align="center" text-anchor="middle" word-spacing="0px" style="font-feature-settings:normal;font-variant-caps:normal;font-variant-ligatures:normal;font-variant-numeric:normal;line-height:1.25" xml:space="preserve"><tspan x="-425.05948" y="144.5038" stroke-width=".26458">Worker threads</tspan></text><text x="-427.40665" y="166.8611" fill="#000000" font-family="'Open Sans'" font-size="2.1167px" letter-spacing="0px" stroke-width=".26458" text-align="center" text-anchor="middle" word-spacing="0px" style="font-feature-settings:normal;font-variant-caps:normal;font-variant-ligatures:normal;font-variant-numeric:normal;line-height:1.25" xml:space="preserve"><tspan x="-427.40665" y="166.8611" stroke-width=".26458">Task queue</tspan></text><path d="m-386.3 172.95c7.3502-6.0322 8.1963-16.693-0.13231-20.373" fill="none" marker-end="url(#a)" stroke="#000" stroke-width=".965"/><rect x="-432.86" y="120.06" width="45.283" height="18.628" fill="#f60" opacity=".497" stroke="#18161a" stroke-linejoin="round" stroke-width=".12575"/><g fill="#e7e0e6" stroke="#18161a" stroke-linejoin="round" stroke-width=".060447"><rect x="-431.87" y="121.3" width="43.364" height="4.4949" opacity=".497"/><rect x="-431.93" y="126.88" width="43.364" height="4.4949" opacity=".497"/><rect x="-432" y="132.54" width="43.364" height="4.4949" opacity=".497"/></g><text x="-426.85422" y="118.53297" fill="#000000" font-family="'Open Sans'" font-size="2.1167px" letter-spacing="0px" stroke-width=".26458" text-align="center" text-anchor="middle" word-spacing="0px" style="font-feature-settings:normal;font-variant-caps:normal;font-variant-ligatures:normal;font-variant-numeric:normal;line-height:1.25" xml:space="preserve"><tspan x="-426.85422" y="118.53297" stroke-width=".26458">Done queue</tspan></text><path d="m-386.6 149.21c7.3502-6.0322 8.1963-16.693-0.13231-20.373" fill="none" marker-end="url(#c)" stroke="#000" stroke-width=".965"/><g><path d="m-448.78 157.21-2.8648-3.3692 2.7188-3.3826 0.13363 1.5579 11.817 0.23143-4e-3 -1.8179 3.3851 3.7575-3.6277 3.3848-0.13429-1.8176-11.427 0.0273z" fill="#acf"/><text x="-442.99722" y="155.21205" fill="#000000" font-family="'Open Sans'" font-size="3.323px" letter-spacing="0px" stroke-width=".41538" text-align="center" text-anchor="middle" word-spacing="0px" style="font-feature-settings:normal;font-variant-caps:normal;font-variant-ligatures:normal;font-variant-numeric:normal;line-height:1.25" xml:space="preserve"><tspan x="-442.99722" y="155.21205" stroke-width=".41538">SYNC</tspan></text><rect x="-470.06" y="121.56" width="16.576" height="50.864" fill="#e7e0e6" stroke="#18161a" stroke-linejoin="round" stroke-width=".12572"/><text x="-461.9382" y="144.28072" fill="#000000" font-family="'Open Sans'" font-size="3.323px" letter-spacing="0px" stroke-width=".41538" text-align="center" text-anchor="middle" word-spacing="0px" style="font-feature-settings:normal;font-variant-caps:normal;font-variant-ligatures:normal;font-variant-numeric:normal;line-height:1.25" xml:space="preserve"><tspan x="-461.9382" y="144.28072">LWS</tspan><tspan x="-461.9382" y="148.43448">Service</tspan><tspan x="-461.9382" y="152.58824">Thread</tspan></text><path d="m-449.01 132.81-2.8648-3.3692 2.7188-3.3826 0.13363 1.5579 11.817 0.23143-4e-3 -1.8179 3.3851 3.7575-3.6277 3.3848-0.13429-1.8176-11.427 0.0273z" fill="#acf"/><text x="-443.23111" y="130.80745" fill="#000000" font-family="'Open Sans'" font-size="3.323px" letter-spacing="0px" stroke-width=".41538" text-align="center" text-anchor="middle" word-spacing="0px" style="font-feature-settings:normal;font-variant-caps:normal;font-variant-ligatures:normal;font-variant-numeric:normal;line-height:1.25" xml:space="preserve"><tspan x="-443.23111" y="130.80745" stroke-width=".41538">reap</tspan></text><text x="-454.41257" y="178.39418" fill="#000000" font-family="'Open Sans'" font-size="1.9144px" letter-spacing="0px" stroke-width=".23929" text-align="center" text-anchor="middle" word-spacing="0px" style="font-feature-settings:normal;font-variant-caps:normal;font-variant-ligatures:normal;font-variant-numeric:normal;line-height:1.25" xml:space="preserve"><tspan x="-454.41257" y="178.39418">All communication with tasks happens</tspan><tspan x="-454.41257" y="180.78712">in lws service thread context, via the</tspan><tspan x="-454.41257" y="183.18007">WRITEABLE callback</tspan></text><rect x="-473.25" y="191" width="31.563" height="12.803" fill="#e7e0e6" opacity=".497" stroke="#18161a" stroke-linejoin="round" stroke-width=".087035"/></g><g fill="#000000" font-family="'Open Sans'" letter-spacing="0px" word-spacing="0px"><text x="-469.11374" y="189.37514" font-size="4.2914px" stroke-width=".53643" text-align="center" text-anchor="middle" style="font-feature-settings:normal;font-variant-caps:normal;font-variant-ligatures:normal;font-variant-numeric:normal;line-height:1.25" xml:space="preserve"><tspan x="-469.11374" y="189.37514" stroke-width=".53643">task</tspan></text><g font-size="2.1167px" stroke-width=".26458"><g text-anchor="middle"><text x="-411.27023" y="124.3083" text-align="center" style="font-feature-settings:normal;font-variant-caps:normal;font-variant-ligatures:normal;font-variant-numeric:normal;line-height:1.25" xml:space="preserve"><tspan x="-411.27023" y="124.3083" stroke-width=".26458">task</tspan></text><text x="-411.24612" y="129.95815" text-align="center" style="font-feature-settings:normal;font-variant-caps:normal;font-variant-ligatures:normal;font-variant-numeric:normal;line-height:1.25" xml:space="preserve"><tspan x="-411.24612" y="129.95815" stroke-width=".26458">task</tspan></text><text x="-411.32364" y="135.46761" text-align="center" style="font-feature-settings:normal;font-variant-caps:normal;font-variant-ligatures:normal;font-variant-numeric:normal;line-height:1.25" xml:space="preserve"><tspan x="-411.32364" y="135.46761" stroke-width=".26458">task</tspan></text><text x="-411.23813" y="149.70833" text-align="center" style="font-feature-settings:normal;font-variant-caps:normal;font-variant-ligatures:normal;font-variant-numeric:normal;line-height:1.25" xml:space="preserve"><tspan x="-411.23813" y="149.70833" stroke-width=".26458">task</tspan></text><text x="-411.18332" y="155.39687" text-align="center" style="font-feature-settings:normal;font-variant-caps:normal;font-variant-ligatures:normal;font-variant-numeric:normal;line-height:1.25" xml:space="preserve"><tspan x="-411.18332" y="155.39687" stroke-width=".26458">task</tspan></text><text x="-411.15262" y="160.68849" text-align="center" style="font-feature-settings:normal;font-variant-caps:normal;font-variant-ligatures:normal;font-variant-numeric:normal;line-height:1.25" xml:space="preserve"><tspan x="-411.15262" y="160.68849" stroke-width=".26458">task</tspan></text><text x="-411.26883" y="172.54805" text-align="center" style="font-feature-settings:normal;font-variant-caps:normal;font-variant-ligatures:normal;font-variant-numeric:normal;line-height:1.25" xml:space="preserve"><tspan x="-411.26883" y="172.54805" stroke-width=".26458">task</tspan></text><text x="-411.26883" y="178.22987" text-align="center" style="font-feature-settings:normal;font-variant-caps:normal;font-variant-ligatures:normal;font-variant-numeric:normal;line-height:1.25" xml:space="preserve"><tspan x="-411.26883" y="178.22987" stroke-width=".26458">task</tspan></text></g><text x="-471.72641" y="194.02657" style="font-feature-settings:normal;font-variant-caps:normal;font-variant-ligatures:normal;font-variant-numeric:normal;line-height:1.25" xml:space="preserve"><tspan x="-471.72641" y="194.02657"><tspan font-weight="bold" stroke-width=".26458">wsi</tspan> (may be detached)</tspan><tspan x="-471.72641" y="196.67239"><tspan font-weight="bold" stroke-width=".26458">task</tspan> function pointer</tspan><tspan x="-471.72641" y="199.31824"><tspan font-weight="bold" stroke-width=".26458">cleanup</tspan> function pointer</tspan><tspan x="-471.72641" y="201.96407"><tspan font-weight="bold" stroke-width=".26458">user</tspan> private pointer</tspan></text></g><text x="-452.33572" y="213.37485" font-size="5.4153px" stroke-width=".67691" text-align="center" text-anchor="middle" style="font-feature-settings:normal;font-variant-caps:normal;font-variant-ligatures:normal;font-variant-numeric:normal;line-height:1.25" xml:space="preserve"><tspan x="-452.33572" y="213.37485" stroke-width=".67691">Threadpool</tspan></text></g><g transform="translate(-414.26 162.67)"><path d="m-53.889 51.059c-0.2293-0.20876-0.45859-0.41752-0.68788-0.62628h-2.0842c-0.41073-0.4478-0.80598-0.91066-1.2269-1.3486-0.15635-0.18661-0.4411-0.26749-0.65538-0.13157-0.2532 0.13273-0.37597 0.41669-0.39448 0.69074-0.04758 0.31909 0.05354 0.68674 0.35175 0.85254 0.18832 0.10808 0.49386 0.04671 0.5437-0.19062 0.06699-0.21357-0.06488-0.51518-0.31343-0.50948-0.16072 3e-3 -0.26391 0.28316-0.07717 0.33226 0.08893 0.01617 0.10978-0.27326 0.17002-0.07939 0.0638 0.17507-0.16528 0.31938-0.28293 0.16402-0.213-0.21052-0.14192-0.60391 0.10406-0.75718 0.23529-0.07437 0.39199 0.16171 0.52824 0.31112 0.3873 0.42849 0.77336 0.85822 1.1601 1.2873 0.95481 0.0017 1.9097 0.0034 2.8645 0.0051z"/><path d="m-56.225 50.077c0.07138-0.08712 0.14278-0.17424 0.21416-0.26135 0.10648 0.11858 0.21295 0.23715 0.31943 0.35573 0.19118 0.0012 0.38235 0.0025 0.57352 0.0036-0.2069-0.22868-0.41381-0.45737-0.62072-0.68605 0.10043-0.11374 0.20086-0.22747 0.30128-0.34121 0.19601 0.22868 0.39203 0.45737 0.58804 0.68605-0.0012-0.219-0.0025-0.43801-0.0036-0.65701-0.10043-0.11252-0.20085-0.22505-0.30128-0.33758 0.07198-0.10615 0.24907-0.21551 0.08668-0.31451-0.36406-0.40214-0.72811-0.80428-1.0922-1.2064-0.76543-0.0026-1.5317 0.01021-2.2966-0.0021-0.1821-0.01604-0.40898-0.07372-0.45071-0.28286-0.088-0.27195 0.21101-0.59285 0.48564-0.46528 0.18982 0.03674 0.11004 0.42003-0.05779 0.29297 0.17429-0.25602-0.31955-0.22697-0.17976 0.02451 0.09575 0.22004 0.44485 0.25635 0.58255 0.05617 0.14323-0.2308-0.05154-0.4937-0.2705-0.58497-0.21915-0.10466-0.49117-0.07771-0.67434 0.08567-0.27378 0.20864-0.40621 0.61643-0.22752 0.92795 0.104 0.233 0.33446 0.38219 0.58455 0.41121 0.33507 0.04187 0.67431 0.01608 1.0114 0.02326h1.3407c0.25409 0.28192 0.50818 0.56384 0.76228 0.84577-0.22868 0.25288-0.45736 0.50576-0.68605 0.75865-0.16572-0.21381-0.41577-0.37628-0.51666-0.63121-0.08161-0.29871 0.35413-0.53156 0.5618-0.30555 0.19943 0.11035-0.01178 0.46291-0.15577 0.26978 0.1166-0.03951 0.16904-0.22582-0.01437-0.21638-0.21499 0.08183-0.12303 0.40655 0.0643 0.46926 0.17871 0.08651 0.40261-0.07556 0.3799-0.27118 0.01826-0.28278-0.18842-0.5907-0.48713-0.60388-0.31967-0.06227-0.68039 0.12472-0.75854 0.45263-0.10766 0.28228 0.06955 0.56541 0.26324 0.75966 0.22723 0.24585 0.44911 0.49691 0.67408 0.74475z" fill="#f00"/><path d="m-54.464 50.361c0.0017-0.54757 0.0034-1.0951 0.0051-1.6427-0.33832-0.38748-0.69457-0.75998-1.021-1.1574-0.10913-0.13496-0.19252-0.29467-0.18614-0.47289-0.0086-0.33136 0.19731-0.65612 0.50556-0.78212 0.23741-0.10513 0.52154-0.11525 0.754 0.0094 0.3243 0.16516 0.47791 0.61109 0.30157 0.93353-0.13519 0.19951-0.48216 0.19542-0.59404-0.0265-0.1079-0.14135-0.10151-0.43084 0.10373-0.47103 0.16696-0.0034 0.20764 0.24106 0.02397 0.25083-0.04085 0.15882 0.28306 0.12232 0.27255-0.04546 0.04138-0.23154-0.21514-0.42013-0.4314-0.37653-0.24357 0.02414-0.45758 0.28096-0.37332 0.52553 0.08871 0.24037 0.30285 0.40102 0.46218 0.59282 0.25613 0.27896 0.51148 0.55865 0.76757 0.83766-0.0017 0.61002-0.0034 1.22-0.0051 1.8301-0.19509-0.0017-0.3902-0.0035-0.58527-0.0051z"/></g><path d="m-449.68 167.64 11.817 0.23143-4e-3 -1.8179 3.3851 3.7575-3.6277 3.3848-0.13429-1.8176-13.274 0.23777c0.0499-1.679 7e-3 -2.161 0.0144-4.0462z" fill="#acf"/><text x="-443.22256" y="170.56471" fill="#000000" font-family="'Open Sans'" font-size="3.323px" letter-spacing="0px" stroke-width=".41538" text-align="center" text-anchor="middle" word-spacing="0px" style="font-feature-settings:normal;font-variant-caps:normal;font-variant-ligatures:normal;font-variant-numeric:normal;line-height:1.25" xml:space="preserve"><tspan x="-443.22256" y="170.56471" stroke-width=".41538">enqueue</tspan></text><g fill="none" stroke="#000"><path d="m-387.42 123.83c1.3484-0.56118 1.6984-1.3714 1.7386-3.1608" marker-end="url(#b)" stroke-width=".965"/><g stroke-width=".26458px"><path d="m-387.65 115.01 1.2568 1.7529"/><path d="m-383.25 120.07 3.4065 1.0253"/><path d="m-383.68 117.3 2.4143-1.2568"/><path d="m-387.19 119.94-1.9513 1.1245"/><path d="m-387.59 118.92-2.8112-0.52916"/><path d="m-384.84 116.57 0.8599-1.6867"/><path d="m-382.92 118.75 2.8773-0.26458"/><path d="m-384.35 120.84 1.3891 2.3151"/><path d="m-387.52 117.66-2.282-1.2237"/></g></g></g></svg>