From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: Spawning threads in KVM/QEMU Date: Wed, 14 Nov 2007 11:43:26 +0200 Message-ID: <473AC33E.4040702@qumranet.com> References: <473A05D6.2040003@us.ibm.com> <473A283B.5040905@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel To: dor.laor-atKUWr5tajBWk0Htik3J/w@public.gmane.org Return-path: In-Reply-To: <473A283B.5040905-atKUWr5tajBWk0Htik3J/w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Dor Laor wrote: > Anthony Liguori wrote: > >> Hi, >> >> I've been experimenting with creating IO threads for the PV device >> drivers. Unfortunately, my experiments haven't gotten very far as QEMU >> tends to hang up a bit into booting the guest whenever I spawn a thread >> that does any sort of read/write on a file descriptor. My suspicion is >> that it has something to do with signals being delivered to the wrong >> thread but after masking out all the signals for this thread, I still >> had no luck. >> >> >> > Maybe you set the mask too late? try setting it before creating the thread: > sigfillset(&thread_sig_mask); > sigdelset(&thread_sig_mask,SIGILL); > sigdelset(&thread_sig_mask,SIGFPE); > sigdelset(&thread_sig_mask,SIGSEGV); > pthread_sigmask(SIG_SETMASK, &thread_sig_mask, &curr_sig_mask); > if ((r = pthread_create(&thread_tid, NULL, thread_func, &init_data))) { > .... > } > pthread_sigmask(SIG_SETMASK, &curr_sig_mask, NULL); > Actually when running with kvm, most signals are blocked while running in userspace. They're only enabled when the guest is running. So no special action should be necessary. For pure qemu, it is necessary of course. -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/