[Gluster-devel] stack_wind questions

Corin Langosch corinl at gmx.de
Wed Oct 29 22:58:49 UTC 2008


Hi,

I just looked some time at the code but I think I just didn't get the
usage of STACK_WIND / STACK_UNWIND right.

Looking at the macros and the translators (for example), STACK_WIND
simply seems to setup some datastructures and then call the suplied
function. After that function is done, the MACRO is done and code
executions continues normal.

So if I put a STACK_WIND into a loop (like in unify) the function passed
in the MACRO is simply called. So the calls don't happen in parallel but
normal seriazliezd, as they would have happened without using
STACK_WIND. So what is STACK_WIND all about - for me it currently seems
to be for passing (some common) data between function calls. It doesn't
execute any functions in parallel in order to reduce latencies caused by
the backends?

The function call in the STACK_UNWIND macro puzzles me even more. What
is this for? As the STACK_UNWIND function is called from within the
function called by STACK_WIND, I'd suspect some kind of loop?

What's about with the while(0) inside the macros. They don't do anything? ;)

Thanks for any clarifications :)
Corin





More information about the Gluster-devel mailing list