qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gabriel Southern <gabriel.southern@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] x86_64-linux-user multithreaded?
Date: Mon, 19 Apr 2010 18:13:32 -0700	[thread overview]
Message-ID: <o2j3c2bf46d1004191813see966b02q9ca9b06246ae10a5@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1106 bytes --]

Hi,

Does the linux-user mode in QEMU support running multithreaded code?
I am most interested in running SPARC binaries, but I tested with
x86_64 and it seems like some system calls needed for pthreads are not
included.  I've attached a very simple program that uses pthreads.
When I run it normally there is an error that says:

qemu: Unsupported syscall: 202

When I run it with the -strace parameter there is additonal information:

6958 futex(0x00000040009fe06c,FUTEX_PRIVATE_FLAG|FUTEX_WAKE,1,0x00000000006895a0,0x0000000000691860,6887520)qemu:
Unsupported syscall: 202
 = -1 errno=38 (Function not implemented)
6958 rt_sigaction(32,274888384256,0,8,274888384432,0) = 0
6958 rt_sigaction(33,274888384256,0,8,274888384432,0) = -1 errno=22
(Invalid argument)
6958 rt_sigprocmask(1,274888384440,0,8,274888384432,0) = 0


What I'm wondering is if the x86_64-linux-user binary is expected to
be able to execute multithreaded programs, or if it is only single
threaded.  Also depending on what the status is I"d be interested to
know if there are any plans to change this in the future.

Thanks,

-Gabriel

[-- Attachment #2: test.c --]
[-- Type: text/x-csrc, Size: 237 bytes --]

#include <pthread.h> 
#include <stdio.h>
#include <unistd.h>

void *foo() {
  printf("called foo\n");
}

int main() {
  pthread_t t;
  int rc = 0;
  rc = pthread_create(&t,0,&foo,0);
  usleep(5000);
  printf("return code is:%d\n",rc);
}

             reply	other threads:[~2010-04-20  1:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-20  1:13 Gabriel Southern [this message]
2010-04-21 14:16 ` [Qemu-devel] x86_64-linux-user multithreaded? Mulyadi Santosa

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=o2j3c2bf46d1004191813see966b02q9ca9b06246ae10a5@mail.gmail.com \
    --to=gabriel.southern@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).