ngx_list_create in shm_zone

Raghavan, Gopal gopal.raghavan at here.com
Tue Aug 23 12:41:06 UTC 2016


I can store as ngx_rbtree_t.
Any suggestion on how to store a struct with list of items, something like this in shared memory?

typedef struct {
    ngx_rbtree_node_t          node;
    ngx_uint_t                          id;
    ngx_list_t                          *items; // list of items. But ngx_list_t is not possible since it needs ngx_pool_t. Any alternatives?
} ngx_http_metadata_shm_block_t;

Thanks,
--
Gopal

On 8/23/16, 7:11 AM, "nginx-devel on behalf of Maxim Dounin" <nginx-devel-bounces at nginx.org on behalf of mdounin at mdounin.ru> wrote:

>Hello!
>
>On Tue, Aug 23, 2016 at 02:51:54AM +0000, Raghavan, Gopal wrote:
>
>> Is it possible to use ngx_list_create and ngx_list_init with share memory?
>> List functions take ngx_pool_t, however shared memory zone provides ngx_slab_pool_t.
>> If yes, could you please share an example.
>
>No, it's not possible.
>
>-- 
>Maxim Dounin
>http://nginx.org/
>
>_______________________________________________
>nginx-devel mailing list
>nginx-devel at nginx.org
>http://mailman.nginx.org/mailman/listinfo/nginx-devel



More information about the nginx-devel mailing list