[Gluster-devel] thread-safety and stack based design

Krishna Srinivas krishna at zresearch.com
Wed Jan 14 16:25:09 UTC 2009


Hi Corin,

What do you mean by stack based design?

On Wed, Jan 14, 2009 at 8:59 PM, Corin Langosch <corinl at gmx.de> wrote:
> Hi again,
>
> I thought glusterfs is using the stack based design instead of a
> threaded one to simplify the internal design etc, for example to get rid
> of nastly thread locking/ synchronization issues.
>
> So I wonder if it is safe to use the io-threads translator in front of
> any other translator than the posix-storage translator. Wasn' the
> io-threads translator be meant to be used directly before the
> posix-storage translator only,  as it's the only translater which has
> blocking system calls?

iothreads can be used anywhere. As you have mentioned its purpose is
to reduce the effect of blocking system calls. All translators are
thread safe.

>
> If all translators are thread-safe, what's the advantage of using a
> stack based approach instead of a multi threaded one anyway?

By stack do you mean stacking translators above one another? It was a
design decision to get better modularity for feature implementation.

Krishna





More information about the Gluster-devel mailing list