Re: thread-safety and stack based design

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

 



Corin,

I think you are referring to STACK_WIND/UNWIND when you say
"stack-based" design. The STACK_WIND/UNWIND macros in effect implement
a continuation-like mechanism in C.

The original reason we introduced this was to make file operations
asynchronous, in that we didn't have to wait for the reply to come
back from a server to issue another request.

Simulating our own stack over the normal C stack has given us many
other advantages. To take a concrete example, if the posix-locks
translator wishes to block a call, all it needs to do is save the
frame for the call and return (return in the C stack). When it needs
to unblock, it simply does a STACK_UNWIND on the saved frame.

Similarly the stack mechanism allows a great deal of control for
translators like unify and afr, where control flow branches, loops,
etc.

By having the stack mechanism we explicitly transfer control from one
translator to another, which gives us enormous flexibility.

Vikas
-- 
Engineer - Z Research
http://gluster.com/




[Index of Archives]     [Gluster Users]     [Ceph Users]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux