From: Timo Suoranta <timo.suoranta@acrodea.co.jp>
To: Qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] ARM multithreading status
Date: Tue, 14 Jul 2009 11:22:07 +0300 [thread overview]
Message-ID: <4A5C402F.6060209@acrodea.co.jp> (raw)
In-Reply-To: <4A56EF1B.8010803@acrodea.co.jp>
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 <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
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;
}
next prev parent reply other threads:[~2009-07-14 8:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-06 15:16 [Qemu-devel] ARM multithreading status Timo Suoranta
2009-07-06 15:28 ` Daniel Jacobowitz
2009-07-06 15:31 ` Paul Brook
2009-07-09 21:40 ` Felipe Contreras
2009-07-10 7:34 ` Timo Suoranta
2009-07-14 8:22 ` Timo Suoranta [this message]
2009-07-14 13:03 ` Timo Suoranta
2009-07-15 20:41 ` Jamie Lokier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A5C402F.6060209@acrodea.co.jp \
--to=timo.suoranta@acrodea.co.jp \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.