繁体   English   中英

多线程Web服务器流程图

[英]Multithreaded Web Server Flow diagram

我正在用C ++写一个具有1个调度线程,1个排队线程和n个执行线程的多线程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
  }

该流程是否正确? 我只需要指示就可以了。

您的伪代码对我来说似乎很合理。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM