nginx编译和调试 nginx源码编译,依赖于pcre和zlib下载源码后,通过./configure --help可以查看编译选项,为了增加gdb调试信息,使用./configure --with-cc-opt='-g -o0'和make CFLAGS="-g -o0" 为了方便调试可以启动一个worker进程nginx对gdb也有辅助支持,用debug_points配置项:st
python 面向对象 一、组成:方法和属性。类定义:class MyClass(): def say(self): print("hello")test=MyClass()test.say()2.属性:self.attr = value普通属性:self.attr=value静态属性:
lua 协程 -- coroutine api: create, resume, yield, wrap. running, status-- coroutine status: suspend, running, normal, deadlocal stop = function() return coroutine.yield(7, 9)end
lua require与module 一、模块机制module 1.什么是module对于用户来说,一个module相当于一个so库。模块的主要目标是实现代码的共享。 2.如何编写modulelua是通过table来实现模块的,典型的写法如下。local M = {} ---- 通常是加local的,如果不加,则M默认注册到_G中,require后,即使不ret
lua local 变量和表 local是我们在lua编程里面经常写的,经常写的方式为local foo = foo。lua对local的处理有加速访问的效果,并且将变量定义为局部变量也是一种好的编程习惯。lua对变量和表的local化处理的方式是不同的======example======foo = {}foo.a =1dolocal foo = foo