AWS IoT Device SDK C: Task Pool
Task pool library
Return to main page ↑
Configuration

Configuration settings of the task pool library.

Configuration settings are C pre-processor constants. They can be set with a #define in the config file (iot_config.h) or by using a compiler option such as -D in gcc. If a configuration setting is not defined, the library will use a "sensible" default value (unless otherwise noted). Because they are compile-time constants, a library must be rebuilt if a configuration setting is changed.

configpagemarker

IOT_TASKPOOL_JOB_WAIT_TIMEOUT_MS

Set this to the desired wait timeout in milliseconds for a worker in the task pool to wait for an incoming job.

If a worker in the task pool wakes up because of a timeout, then the worker will terminate if it exceeds the desired minimum thread quota, which the user can configure via IotTaskPoolInfo_t::minThreads.

Default value (if undefined): 1 minute

IOT_TASKPOOL_JOBS_RECYCLE_LIMIT

Set this to the number of recyclable tasks for the task pool to cache.

Caching dynamically allocated tasks (recyclable tasks) helps the application to limit the number of allocations at runtime. Caching recyclable tasks may help making the application more responsive and predictable, by removing a potential for memory allocation failures, but it may also have negative repercussions on the amount of memory available at any given time. It is up to the application developer to strike the correct balance these competing needs. The task pool will cache when the application calling IotTaskPool_RecycleJob. Any recycled tasks in excess of IOT_TASKPOOL_JOBS_RECYCLE_LIMIT will be destroyed and its memory will be release.

Default value (if undefined): 8

IOT_TASKPOOL_ENABLE_ASSERTS

Set this to 1 to perform sanity checks when using the task pool library.

Asserts are useful for debugging, but should be disabled in production code. If this is set to 1, IotTaskPool_Assert can be defined to set the assertion function; otherwise, the Iot_DefaultAssert will be used.

Possible values: 0 (asserts disabled) or 1 (asserts enabled)
Recommended values: 1 when debugging; 0 in production code.
Default value (if undefined): 0

IOT_LOG_LEVEL_TASKPOOL

Set the log level of the task pool library.

Log messages from the task pool library at or below this setting will be printed.

Possible values: One of the Log levels.
Default value (if undefined): IOT_LOG_LEVEL_GLOBAL; if that is undefined, then IOT_LOG_NONE.