|
From: | Raghavendra G |
Subject: | Re: [Gluster-devel] rpc problems when using syncops in callbacks |
Date: | Wed, 1 May 2013 20:07:26 +0530 |
I would say that the callback passed to STACK_WIND is very much like a
continuation, and a synctask is a thread even if there's one callback at
the end.
As is usually the case with events vs. threads, the STACK_WIND
approach provides more flexibility but also breaks up the flow of
control and requires explicit (non-stack) state, so code is
significantly harder to read and debug.
Unfortunately, synctasks also
hamper debugging in their own way because they use stacks that gdb can't
understand, so in many cases real threads are even better. My general
preference would be to use STACK_WIND etc. for main-line code and
threads for background/maintenance tasks with more complex
blocking/looping needs. In particular, any recursive code (such as
walking a directory tree in self-heal or rebalance) needs to be in a
thread or synctask because of stack-depth concerns.
_______________________________________________
Gluster-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/gluster-devel
[Prev in Thread] | Current Thread | [Next in Thread] |