From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Fehlig Subject: Re: help with xenstored 'hang' Date: Thu, 01 Jul 2010 17:03:24 -0600 Message-ID: <4C2D1EBC.4060105@novell.com> References: <4C2BC1FD.5050404@novell.com> <4C2D0904.6050801@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Patrick Colp Cc: xen-devel List-Id: xen-devel@lists.xenproject.org Patrick Colp wrote: > On 1 July 2010 14:30, Jim Fehlig wrote: > >> Patrick Colp wrote: >> >>> I was recently struggling with what sounds like a not-too-dissimilar >>> problem while working with a disaggregated version of xenstore. The >>> ultimate solution for me was to disable pthreads in xenstore/libxs. I >>> just commented out the following line in tools/xenstore/Makefile: >>> >>> xs.opic: CFLAGS += -DUSE_PTHREAD >>> >>> After I removed that line and rebuilt and installed xenstore, it >>> worked just fine. I would be curious to know if this also solves your >>> problem. >>> >>> >> After more thought, this seems like it could cause problems in xend, >> which is multi-threaded. This change essentially make the xenstore >> client library thread-unsafe correct? >> > > I don't think so. I think it just makes the xenstore library single > threaded. Right. But AFAICT, multiple threads in xend could use the single xs_handle, allowing these threads to write to the handle's fd simultaneously. With the pthreads impl, these threads must acquire the handle's req_mutex before writing. > In my case, I was using a single threaded application and > still ran into this problem, as the xenstore library seems to have > multiple threads. It spawns one reader thread only. Requests and responses are handled on the caller's thread of control. Regards, Jim