我正在寫一個多線程的Web服務器,1個調度線程,1個排隊線程和n個執行線程在C++中,這是一個作業問題。我不問代碼。我爲服務器創建了一個流程。你能告訴我流量是否正確?多線程的Web服務器流程圖
main() //queuing thread
{
define sockets
create scheduling thread
create queue of n execution threads //n execution threads
accpet connection infinetly
{
insert the request in a queue
}
}
scheduling thread // scheduling thread
{
job = take each request from queue (FCFS or SJF)
take 1 thread from queue of execution threads and assign the job request
}
問題是否正確?我只需要方向。提前感謝。
感謝提示@cHao。我不會「濫用」標誌爲:)將簡單刪除:)乾杯 – sehe