lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Well, the goal of luajit.io is to re-implement nginx in pure lua, so withou question, it moves the exact architecture into lua land, including the multi-processing (master/workers) and event-poll model. So as long as you understand nginx, you understand luajit.io.
The luajit.io does not use multi-threading, but it indeed uses pthread API in PTHREAD_PROCESS_SHARED mode, which is used to do locking upon the shared memory among processes (see slab.lua and shdict.lua).
And note that the DNS resolving uses getaddrinfo_a() from libc, which does async queries in the background threads. But that's transparent to luajit.io.

Best Regards,
Jinhua Luo

2015-04-17 19:24 GMT+08:00 Emeka <emekamicro@gmail.com>:
Going through your code ... Pretty clean though I am having some problem wrapping my head around.... Looks like you used epoll for event readiness , and also thread ... which I can't figure out why. You also used process , why? Or is this a form of constraint based server. Sorry, I am trying to understand server and everything around it.  \Emeka

On Fri, Apr 17, 2015 at 9:44 AM, Jinhua Luo <luajit.io@gmail.com> wrote:
Hi,

Thanks.
Last night, I wrote a simple socks5 server as generic tcp server demo.
https://github.com/kingluo/luajit.io#generic-tcp-server
Have fun! :)

Best Regards,
Jinhua Luo


2015-04-16 20:58 GMT+08:00 Ignacio Burgueño <iburgueno@gmail.com>:
Nice! Good luck with it.​




--
P.S Please join our groups:  nigeriaarduinogroup@googlegroups.com
 or jifunze-kufikiria@googlegroups.com  These are platforms for learning and sharing  of knowledge.                                                                                      www.satajanus.com | Satajanus  Nig. Ltd