rt

解决方案 »

  1.   

    我在做的是一个压力测试的东西,模拟很多客户端去访问服务商的服务,看他对不同数量客户端访问的承受能力,难道是系统对建立的socket连接数量有限制?
      

  2.   

    The number of threads a process can create is limited by the available virtual memory. By default, every thread has one megabyte of stack space. Therefore, you can create at most 2028 threads. If you reduce the default stack size, you can create more threads. However, your application will have better performance if you create one thread per processor and build queues of requests for which the application maintains the context information. A thread would process all requests in a queue before processing requests in the next queue. 
      

  3.   

    多谢楼上,^_^
    不过how to reduce stack size呢?
    而且好像没建立一个CCocket的对象系统就自动创建一个线程,那这些线程的堆栈大小又改如何改变呢?怎么取得这些线程的ID?
      

  4.   

    操作系统最多也就支持那么多线程
    WIN98之类更少
      

  5.   

    嗯,线程的数目上限应该还是由服务端决定的,只不过线程多了,可能cpu 内存什么的满足不了