![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
nginx
hintonic
这个作者很懒,什么都没留下…
展开
-
nginx round robin 算法的实现
ngx_int_tngx_http_upstream_get_round_robin_peer( ngx_peer_connection_t *pc, void *data ){ ngx_http_upstream_rr_peer_data_t *rrp = data; time_t now; uint原创 2012-01-19 10:46:18 · 2435 阅读 · 1 评论 -
nginx_alloc
/* * Copyright (C) Igor Sysoev */#ifndef _NGX_ALLOC_H_INCLUDED_#define _NGX_ALLOC_H_INCLUDED_#include #include void *ngx_alloc(size_t size, ngx_log_t *log);void原创 2012-01-31 09:39:51 · 519 阅读 · 0 评论 -
nginx_palloc
http://wenku.baidu.com/view/31fe434dfe4733687e21aae1.htmlhttp://apps.hi.baidu.com/share/detail/33027791http://down.chinaz.com/server/201201/1577_1.htmhttp://www.abo321.org/原创 2012-01-31 14:38:28 · 668 阅读 · 0 评论 -
nginx_array
二倍自动扩容自增的数组,类似stl的vector,使用pool分配,pool的d.last 指定了最后一个分配的页,分配时优先从这个page中看有没有剩余的空间,如果有则直接从这里分配,没有的话就要二倍递增,再次尝试分配/* * Copyright (C) Igor Sysoev */#ifndef _NGX_ARRAY_H_INCL原创 2012-01-31 10:59:54 · 579 阅读 · 0 评论 -
nginx ngx_list 定长数据块的分配链表
每次分配固定一大块,然后一块一块的从中切,大块构成一个链表没有回收操作,都是分配操作,只支持定长数据块的分配,适用于 只有分配操作,没有释放操作的场合,比如只读的定长数据块cache中内存块的分配/* * Copyright (C) Igor Sysoev */#ifndef _NGX_LIST_H_INCLUDED_#defin原创 2012-01-20 15:25:27 · 587 阅读 · 0 评论 -
nginx ngx_times
/* * Copyright (C) Igor Sysoev */#ifndef _NGX_TIMES_H_INCLUDED_#define _NGX_TIMES_H_INCLUDED_#include #include typedef struct { time_t sec; ngx_uin原创 2012-01-20 15:21:01 · 2120 阅读 · 0 评论 -
nginx evnent_posted 线程处理函数
/* * Copyright (C) Igor Sysoev */#ifndef _NGX_EVENT_POSTED_H_INCLUDED_#define _NGX_EVENT_POSTED_H_INCLUDED_#include #include #include #if (NGX_THREADS)extern原创 2012-01-20 14:51:44 · 1304 阅读 · 2 评论 -
nginx教程:nginx 中处理 stale event
http://www.linuxde.net/2011/12/3741.htmlman 7 epoll会发现这个东西,就是使用epoll中会遇到的问题:o If using an event Cache… If you use an event cache or store all the file descriptors returned fr转载 2012-01-20 14:33:41 · 756 阅读 · 2 评论 -
nginx ngx_process 2
ngx_pid_tngx_execute( ngx_cycle_t *cycle, ngx_exec_ctx_t *ctx ){return ngx_spawn_process( cycle, ngx_execute_proc, ctx, ctx->name,NGX_PROCESS_DETACHED );}// execve 执行对应的exe文件stat原创 2012-01-20 15:56:22 · 902 阅读 · 0 评论 -
nginx ngx_process 1
/* * Copyright (C) Igor Sysoev */#ifndef _NGX_PROCESS_H_INCLUDED_#define _NGX_PROCESS_H_INCLUDED_#include typedef pid_t ngx_pid_t;#define NGX_INVALID_PI原创 2012-01-20 15:55:47 · 664 阅读 · 0 评论 -
nginx atomic x86
/* * Copyright (C) Igor Sysoev */#ifndef _NGX_ATOMIC_H_INCLUDED_#define _NGX_ATOMIC_H_INCLUDED_#include #include #if (NGX_HAVE_LIBATOMIC)#define AO_REQUIRE_原创 2012-01-19 17:58:17 · 2129 阅读 · 1 评论 -
nginx pthread mutex and condtion signal
/* * Copyright (C) Igor Sysoev */#ifndef _NGX_THREAD_H_INCLUDED_#define _NGX_THREAD_H_INCLUDED_#include #include #if (NGX_THREADS)#define NGX_MAX_THREADS 1原创 2012-01-19 17:49:34 · 907 阅读 · 0 评论 -
nginx queue
/* * Copyright (C) Igor Sysoev */#include #include #ifndef _NGX_QUEUE_H_INCLUDED_#define _NGX_QUEUE_H_INCLUDED_typedef struct ngx_queue_s ngx_queue_t;struc原创 2012-01-19 11:40:20 · 633 阅读 · 0 评论 -
nginx ip_hash 算法的实现
感觉nginx的 ip hash 每次hash后的值都变化了啊,不会总是路由到一台机器,这里的根据ip hash 岂不是没有意义了?/* * Copyright (C) Igor Sysoev */#include #include #include typedef struct { /* the round rob原创 2012-01-19 11:05:23 · 6703 阅读 · 1 评论 -
fcntl使用
fcntl使用功能描述:根据文件描述词来操作文件的特性。#include #include int fcntl(int fd, int cmd); int fcntl(int fd, int cmd, long arg); int fcntl(int fd, int cmd, struct flock *lock);[描述]fcntl()针转载 2012-11-09 07:39:08 · 544 阅读 · 0 评论