Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lwcug-0003Zs-5t for qemu-devel@nongnu.org; Wed, 22 Apr 2009 09:54:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lwcua-0003YK-VO for qemu-devel@nongnu.org; Wed, 22 Apr 2009 09:54:57 -0400 Received: from [199.232.76.173] (port=45570 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lwcua-0003YB-Kw for qemu-devel@nongnu.org; Wed, 22 Apr 2009 09:54:52 -0400 Received: from psmtp08.wxs.nl ([195.121.247.22]:45060) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Lwcua-00068Y-4B for qemu-devel@nongnu.org; Wed, 22 Apr 2009 09:54:52 -0400 Received: from sim-instruments.com (static.kpn.net [195.7.151.2]) by psmtp08.wxs.nl (iPlanet Messaging Server 5.2 HotFix 2.15 (built Nov 14 2006)) with ESMTP id <0KII00JIH9BCF6@psmtp08.wxs.nl> for qemu-devel@nongnu.org; Wed, 22 Apr 2009 15:54:48 +0200 (MEST) Date: Wed, 22 Apr 2009 15:54:48 +0200 From: Henri Zikken Message-id: <4D960E28DF88A14F8C35749BFCE169D68FF67F@srv001.sim-instruments.com> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: quoted-printable Content-class: urn:content-classes:message Subject: [Qemu-devel] using pthread on usermode, almost works.. but new thread blocks execution List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Though I know it's not recommended, I'm trying to use threads on = qemu-ppc usermode. Unfortunatelly I have no other options. Though I get no errors and the app does run, the created thread hogs the = system. I have tried setting a different scheduler, sigmask, and so on, but to = no avail. I'm using a Debian system, the target platform is powerpc-603. I use = crosstools to compile. This demo program shoud printout 'foo' and 'bar'.. but when run under = qemu-ppc (usermode) it only keeps printing 'foo'. Are there any options to fix this problem, or should I just accept that = this isn't going to work? #include #include #include #include #include void *start_routine(void *arg)=20 { int i; while (1=3D=3D1) { printf("foo\n"); i+1; sched_yield(); =20 } =09 } int main(int argc, char *argv[])=20 { =09 pthread_t p_thread[1];=09 int cnt; int i; pthread_attr_t tattr; sigset_t *newset, *oldset; pthread_attr_init(&tattr);=09 sigfillset( newset ); pthread_sigmask( SIG_BLOCK, newset, oldset ); pthread_attr_setschedpolicy( &tattr, SCHED_RR ); pthread_create( &p_thread[0], &tattr, start_routine, (void *)cnt ); = =09 =09 while (1=3D=3D1) { printf("bar\n"); =20 i+1; sched_yield(); =20 } } Best regards, =A0 Henri Zikken