From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: Can Xen sleep or wake up a thread? Date: Wed, 9 Oct 2013 12:15:58 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Xinxin Jin Cc: "Xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Tue, Oct 8, 2013 at 4:11 PM, Xinxin Jin wrote: > Hi everyone, > > I found in Xen, when synchronization between multiple threads is needed, Xen > always uses busy wait or simple spin lock. In linux, the kernel can block a > waiting thread and schedule other threads for execution. Why does Xen do not > have this mechanism? I guess it is because the performance issue? A lot of > appreciation for your answer !! Linux keeps per-thread kernel stacks, so it can call schedule() and block in the middle of kernel code. Xen does not keep per-vcpu hypervisor stacks, so in general it cannot block in the middle of hypervisor code. -George