multithreading - Looking for a Linux threadpool api with OS scheduler support -


i'm looking thread pool abstraction in linux provides same level of kernel scheduler support win32 thread pool provides. specifically, i'm interested in finding thread pool maintains number of running threads. when running pool thread blocks on i/o, want thread pool smart enough start thread running.

anyone know of linux?

you can't without os support. there's no way tell thread blocked on i/o. wind having atomically increment counter before each operation might block , decrement after. need thread monitor counter , create additional thread if it's above zero. (remove threads if they're idle more second or so.)

generally speaking, it's not worth effort. works on windows because it's "windows way" , windows built ground it. linux, should using epoll or boost::asio. use things "linux way" rather trying make windows way work on non-windows operating systems.

you can write own wrappers use iocp on windows, epoll on linux, , on. these exist, need not bother.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -