[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: question for lua-COCO implementation
- From: takehiro iyatomi <iyatomi@...>
- Date: Mon, 19 Apr 2010 18:31:05 +0900
Dear lua mailing list members, nice to meet you :)
I am Japanese game developer who join this mailing list recently.
currently I develop application framework on distribute computing system like AWS
and I chose lua for its script language.
in this project, I need a 'true' coroutine of lua because this framework uses RPC heavily inside, so lua-COCO provide great help for me, thanks.
but I have 2 question for COCO implementation.
1. according to src/lcoco.c,
#define COCO_MIN_CSTACKSIZE (32768+4096)
coco consumes at least 36K memory for each coroutine. can it be smaller?
because for my project, it is possible that 10k+ coroutine run concurrently and seldom uses stacks. so I want to reduce memory usage.
2. this peace of code in lcoco.c
#ifndef COCO_DISABLE_EARLY_FREE
if (L->status != LUA_YIELD) {
COCO_FREE(L)
}
#endif
I define COCO_DISABLE_EARLY_FREE and test, it seems work fine.
so is there any reason that this definition is disabled by default? if it is enabled, we can reuse coroutine without having any overhead of additional malloc/free.
regards,
--
Takehiro Iyatomi(弥富 豪宏)
mail: iyatomi@gmail.com
twitter: http://twitter.com/umegaya