qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] ARM multithreading status


From: Timo Suoranta
Subject: Re: [Qemu-devel] ARM multithreading status
Date: Tue, 14 Jul 2009 11:22:07 +0300
User-agent: Thunderbird 2.0.0.22 (Windows/20090605)

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;
}






reply via email to

[Prev in Thread] Current Thread [Next in Thread]