Re: [asio-users] ASIO multiprocessor scalability
Brought to you by:
chris_kohlhoff
From: Yuri T. <yti...@gm...> - 2011-06-30 13:30:39
|
> > > Just out of curiosity: did you try it with the latest ASIO, which is > included in 1.47beta? Perhaps, it performs slightly better, due to > reduced copying of handler functors (especially with MSVC10). > Besides, try examining your code for cache coherency issues. > Ensure that you use make_shared instead of direct creation, and pass > shared_ptrs by const reference. > No, I didn't try 1.47. As I mentioned above CPU load isn't an issue (according to task manager, each core's load < 50%). And excessive copying usually results in high CPU load (we also had such issues :) ). Marat's idea about allocators sounds good since malloc may cause too much locking. Unfortunately I can't use tcmalloc globally, since I'm on windows, MSVC 2010 too. I also suspect that there can be issue with spawning threads. In addition to receiving video we poll 2 times per second for IO status, and for each request we create a separate io_service object (it's legacy design, for video we use single connection with async_read_some calls). However, for async_connect ASIO spawns a thread (per io_service object) which calls select. This results in ~40 threads spawned and joined each second (may me twice more timer thread, I'm not sure). Now I'm evaluating Intel's tools. BTW, regarding Marat's note: > I had to use my own binders because of MSVC10 (2010) needs explicit move > constructors and boost::bind-created functors > doesn't have them. Do std::bind or lambdas have similar issues? You can workaround your problem by pulling bind from proper namespace depending on C++0x status. Thanks for ideas, I'll try to keep you informed. Yuri |