[Kosmosfs-users] No concurrency at all ? Why is the KfsClient a global Singleton ?
Status: Alpha
Brought to you by:
sriramsrao
|
From: Kai L. <K.L...@li...> - 2008-02-28 10:00:46
|
Hello,
I'm currently evaluating KosmosFs for some usage scenarios.
Looking through the source code of KosmosFs, I noticed
that every access through a single KfsClient is guarded by a mutex.
That is, every access to Kfs through a single client is serialized.
This is fine for me, if not for one reason - The KfsClient is a global
singleton.
This is from KfsClient.h:
///\brief The KfsClient is the "bridge" between applications and the
/// KFS servers (either the metaserver or chunkserver): there can be
/// only one client per application; the client can interface with
/// only one metaserver.
This is enforced by the fact that KfsClient has a private constructor,
and can only be accessed by using the KfsClient::Instance() Method.
Why this limitation ? Is there any reason why I couldn't or shouldn't
create more
than one instance of KfsClient ? (For example, one per Thread, or one per
backend Meta-Server)
Sure, it is thread safe as it is, but that is achieved by preventing
concurrency.
with best regards,
Kai Londenberg
|