umegaya / pulpo

multi-thread network server library build with coroutine and luajit FFI at ground level
7 stars 2 forks source link

Umegaya/feature/integrate t and p #1

Closed umegaya closed 10 years ago

umegaya commented 10 years ago

now thread module and poller module seem to work correctly in test case, I integrate these 2 modules, for building multithread network client/server easily.

see test/pulpo.lua, it can easily declare 4 thread server and 2 thread client, work together.

caveats: pulpo's multithread server implementation rely on SO_REUSEPORT option, which allows multiple threads/processes listen on same port. but at OSX it turns out that only the thread, which open such a listen socket on first, can accept incoming connection. so actually multi-thread server performance is just like single thread server. further investigation is carrying out now.