在nginx的启动过程中,ngx_init_cycle这个函数做了大部分的初始化工作,而初始化的变量都保存在ngx_cycle_t这个结构体中,为了深入了解这个函数都做了那些初始化工作,就化时间研究了一下,并写下来以便以后参考。
1ngx_cycle_t
关于这个结构体前面已经简单介绍过,这里不再赘述。
2ngx_init_cycle
ngx_cycle_t * ngx_init_cy...
分类:
其他好文 时间:
2014-10-11 19:50:56
阅读次数:
246
voidngx_process_events_and_timers(ngx_cycle_t*cycle){ngx_uint_tflags;ngx_msec_ttimer,delta;if(ngx_timer_resolution){timer=NGX_TIMER_INFINITE;flags=0;}...
分类:
其他好文 时间:
2014-10-10 13:18:24
阅读次数:
167
Linked List CycleGiven a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?使用快慢指针,如果有循环两指针必定能相遇: 1 p...
分类:
编程语言 时间:
2014-10-08 04:32:34
阅读次数:
298
给定一个链表,确定它是否有一个环,不使用额外的空间?...
分类:
其他好文 时间:
2014-10-04 16:08:26
阅读次数:
151
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
bool hasCycl...
分类:
其他好文 时间:
2014-10-04 15:09:06
阅读次数:
187
The Utopian tree goes through 2 cycles of growth every year. The first growth cycle occurs during the monsoon, when it doubles in height. ...
分类:
编程语言 时间:
2014-10-04 14:20:56
阅读次数:
238
Given a linked list, determine if it has a cycle in it.
Follow up:
Can you solve it without using extra space?
这个题目用快慢指针来做,重点在于代码怎么实现的简洁方便理解。
这里用快指针来判断链表是不是有NULL,没有NULL那再继续走,看是否能与慢指针遇上...
分类:
其他好文 时间:
2014-10-01 10:16:10
阅读次数:
309
【题目】Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?【题意】 推断一个单向链表是否有环【思路】 维护两个指针p1和p2,p1.....
分类:
其他好文 时间:
2014-09-28 21:16:55
阅读次数:
195
LeetCode算法题Linked List Cycle 和Linked List Cycle II 详解...
分类:
其他好文 时间:
2014-09-25 16:32:09
阅读次数:
162