linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Zdenek Kabelac <zdenek.kabelac@gmail.com>
To: LVM general discussion and development <linux-lvm@redhat.com>
Cc: Alexander Lyakas <alex.bolshoy@gmail.com>
Subject: Re: [linux-lvm] lvm_t handles and thread-safety
Date: Mon, 01 Aug 2011 13:05:38 +0200	[thread overview]
Message-ID: <4E368882.2060700@redhat.com> (raw)
In-Reply-To: <CAGRgLy4Qk1r7Zd-uOZc7araf2tpfFLgGGigv7xyzfvrkMo2hmQ@mail.gmail.com>

Dne 1.8.2011 10:12, Alexander Lyakas napsal(a):
> Hello everybody,
> I am using stock ubuntu natty with lvmlib 2.02.66.
> 
> In my application I would like to have several threads, each operating
> on a different VG.
> 
> When I tried to share the same lvm_t handle between the threads, very
> soon I got segmentation faults in dm_hash operations. Looking at the
> code, I indeed saw that the contents of lvm_t are used without
> synchronization.


lvm library is not thread safe and it's quite far from being thread safe.

So there is no point on having 2 handles on 2 VGs - it will not work.

> 
> Are there any plans or intentions to provide some support for
> threading with lvmlib?
> 

With current version of lvm2 code there is no way.

Just use the pthread mutex around the lvm command. It's serialized in kernel
anyway. So you cannot gain any speed by using threads. (Check the clvmd code.)


Zdenek

  reply	other threads:[~2011-08-01 11:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-01  8:12 [linux-lvm] lvm_t handles and thread-safety Alexander Lyakas
2011-08-01 11:05 ` Zdenek Kabelac [this message]
2011-08-21 18:15   ` Alexander Lyakas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E368882.2060700@redhat.com \
    --to=zdenek.kabelac@gmail.com \
    --cc=alex.bolshoy@gmail.com \
    --cc=linux-lvm@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).