October 9th Friday

  The long holiday past.  From today I begin studying the nginx.  In a month, I have to master the key of nginx.  I have not more time to study.  But it is not a happy thing to read the sources.

 

  Let's decompress the tar file of the nginx.  There are several folders in the main folder.

 

  core    event    http    mail    misc    os

 

  core:      the core sources; including core modules.

  event:    the event logic in the nginx.

  http:       http core modules.

  mail:       mail core modules.

  os:          the sources on various OS.

  misc:       utility sources.

 

Firstly, let's take a look the structure of ngx_pool.  The structure is revised.  In the newest version is as follow.

 

typedef struct {
    u_char                  *last;
    u_char                  *end;
    ngx_pool_t           *next;
    ngx_uint_t            failed;
} ngx_pool_data_t;


struct ngx_pool_s {
    ngx_pool_data_t        d;
    size_t                          max;
    ngx_pool_t                 *current;
    ngx_chain_t                *chain;
    ngx_pool_large_t        *large;
    ngx_pool_cleanup_t    *cleanup;
    ngx_log_t                    *log;
};

 

The old version structure is here.

 

struct ngx_pool_s {
    u_char                        *last;
    u_char                        *end;
    ngx_pool_t                 *current;
    ngx_chain_t               *chain;
    ngx_pool_t                 *next;
    ngx_pool_large_t       *large;
    ngx_pool_cleanup_t   *cleanup;
    ngx_log_t                   *log;
};

 

The members last, end, and next in the old structure is replaced ngx_pool_data_t.  The member failed is added newly.

I sought two figures on the pool structures in the nginx.   They can help us understand the logic structure of the pool.

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值