[tarantool-patches] Re: [PATCH 1/2] swim: pool IO tasks

Konstantin Osipov kostja at tarantool.org
Sat Jul 6 02:01:36 MSK 2019


* Vladislav Shpilevoy <v.shpilevoy at tarantool.org> [19/07/06 01:39]:
> +
> +/**
> + * All the SWIM instances and their members use the same objects
> + * to send data - tasks. Each task is ~1.5KB, and on one hand it
> + * would be a waste of memory to keep preallocated tasks for each
> + * member. One the other hand it would be too slow to allocate
> + * and delete ~1.5KB on each interaction, ~3KB on each round step.
> + * Here is a pool of free tasks shared among all SWIM instances
> + * to avoid allocations, but do not keep a separate task for each
> + * member.
> + */
> +static struct stailq swim_task_pool;
> +/** Number of pooled tasks. */
> +static int swim_task_pool_size = 0;

These should be thread-local.

Why not use mempool?


-- 
Konstantin Osipov, Moscow, Russia




More information about the Tarantool-patches mailing list