From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MQdHU-0002oR-Df for qemu-devel@nongnu.org; Tue, 14 Jul 2009 04:22:32 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MQdHP-0002o6-Ta for qemu-devel@nongnu.org; Tue, 14 Jul 2009 04:22:32 -0400 Received: from [199.232.76.173] (port=52279 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MQdHP-0002o3-OY for qemu-devel@nongnu.org; Tue, 14 Jul 2009 04:22:27 -0400 Received: from mow302.securemx.jp ([210.130.202.52]:34405 helo=mow.securemx.jp) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MQdHP-0000cw-1L for qemu-devel@nongnu.org; Tue, 14 Jul 2009 04:22:27 -0400 Received: from [192.168.128.141] (xdsl-205-43.nblnetworks.fi [83.145.205.43]) by smtp.securemx.jp (mx-mbox301) id n6E8MDZt027776 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Tue, 14 Jul 2009 17:22:16 +0900 Message-ID: <4A5C402F.6060209@acrodea.co.jp> Date: Tue, 14 Jul 2009 11:22:07 +0300 From: Timo Suoranta MIME-Version: 1.0 Subject: Re: [Qemu-devel] ARM multithreading status References: <3646AB84-79BE-4327-A732-57661E3C8919@acrodea.co.jp> <94a0d4530907091440i65d16776vc1b575f9c5a8d454@mail.gmail.com> <4A56EF1B.8010803@acrodea.co.jp> In-Reply-To: <4A56EF1B.8010803@acrodea.co.jp> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Qemu-devel Using qemu-system-arm, pthread_create() does not seem to return if I give it function which simply has empty infinite loop. Is that supposed to work? I used this: http://people.debian.org/~aurel32/qemu/armel/ Funny thing is, such test actually works fine if I run it through GDB. No need to step, just run. I've attached my test code below as it is not very long. Any ideas? To me it looks like scheduler is not preempting :/ Thanks! -- timo #include #include #include #include #include void* forever(void *arg) { printf("entering forever\n"); for(;;){} printf("leaving forever\n"); return 0; } int main(int argc, char *argv[]) { int res; pthread_t thread; printf("pthread_create...\n"); res = pthread_create(&thread, 0, forever, 0); printf("pthread_create done\n"); if(res != 0) { printf("pthread_create() failed\n"); exit(-1); } printf("pthread_detach...\n"); res = pthread_detach(thread); printf("pthread_detach done\n"); if(res != 0) { printf("pthread_detach() failed\n"); exit(-1); } printf("calling pthread_detach() ok\n"); return 0; }