You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using Poco::Net, and I would like to set some OS specific properties ( e.g. affinity mask ) to the threads that framework will use. Hence, I need to modify every threads created by the ThreadPool passed to the HTTPServer.
The way I am doing it is by creating a ThreadPool with constant capacity (minCapacity == maxCapacity) and running an initial set of Runnable, whose task is to set up initial threads. However doing so I loose the dynamic behavior of the ThreadPool.
Would it be possible to give a callback, to be executed on every new Thread created by a ThreadPool ?
Moreover, in order to set up every initial thread, I had to write a little bit of synchronization, to be sure my set up would run exactly once on every thread. May the ThreadPool provide a way to safely iterate on current threads ?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I am using Poco::Net, and I would like to set some OS specific properties ( e.g. affinity mask ) to the threads that framework will use. Hence, I need to modify every threads created by the ThreadPool passed to the HTTPServer.
The way I am doing it is by creating a ThreadPool with constant capacity (minCapacity == maxCapacity) and running an initial set of Runnable, whose task is to set up initial threads. However doing so I loose the dynamic behavior of the ThreadPool.
Would it be possible to give a callback, to be executed on every new Thread created by a ThreadPool ?
Moreover, in order to set up every initial thread, I had to write a little bit of synchronization, to be sure my set up would run exactly once on every thread. May the ThreadPool provide a way to safely iterate on current threads ?
regards,
Beta Was this translation helpful? Give feedback.
All reactions