📄 5 webserver_multithread.sd
字号:
client1:Process[p] "Googlebot"
client2:Actor[r] "Surfer"
webServer:Server[pr] "Webserver"
t1:Thread[at]
t2:Thread[at]
localDisk:HDD
*1 client1
The Google bot in search of
pages it can index.
*1
*2 client2
An internet surfer in search
of information or such.
*2
*3 t1
These are two threads from
the webserver's thread pool.
*3
(1)client1
(2)client2
(3)t1
(3)t2
client1:webServer.GET /
webServer:t1.process request "GET /"&
t1[,0]:page=localDisk.read("/var/www/index.html")&
client2:webServer.GET /doc/menu.html
*4client1
Waiting for the information to arrive.
*4
webServer:t2.process request "GET /doc/menu.html"&
t2[,1]:page=localDisk.read("/var/www/doc/menu.html")
(4)client2
t2:client2.send(page)
t1[,0]:client1.send(page)
t1:stop
t2[,1]:stop
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -