The current libpwq implementation is oriented towards client programs. We should add tuning options suitable for server programs. The following tuning has been reported to improve behavior in a server environment:
I propose we create a public data structure named pwq_config that contains all of the tunable options for the library. Clients would be allowed to manipulate these options directly. Example:
pwq_config.minimum_threads = 100;
pwq_config.initial_threads = 100;
pwq_config.worker_idle_seconds_threshold = 600;
pwq_config.manager_wake_interval = 10;
In addition to exposing all of the tuning options, it would be nice to have the concept of a "profile" so you could specify the type of environment and have the library set the corresponding tuning options. . There would be function calls to allow you to set the desired profile. Example:
typedef enum {
PWQ_PROFILE_DEFAULT,
PWQ_PROFILE_CLIENT,
PWQ_PROFILE_SERVER,
PWQ_PROFILE_EMBEDDED,
} pwq_profile_types;
pthread_workqueue_set_profile(PWQ_PROFILE_SERVER);