Subject: Re: PTHREAD_CONCURRENCY and large SMP (8 CPUs)
To: None <current-users@netbsd.org>
From: haad <haaaad@gmail.com>
List: current-users
Date: 12/01/2005 17:46:29
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Nicolas Joly wrote:
> Hi,
>
> While playing with a 8 CPUs amd64 machine (4x dual-core 865 Opterons),
> i noticed that a simple threaded program (source attached) does not
> work with PTHREAD_CONCURRENCY >= 6. I already tested this small
> program on NetBSD/i386 and NetBSD/amd64, but never with 8 CPUs.
>
> Is there anything i can tweak to make it work ?
>
> njoly@thorgal [~]> PTHREAD_CONCURRENCY=8 ./thr
> main hello world
> thread hello world
> assertion "next != 0" failed: file "/local/src/NetBSD/src/lib/libpthread/pthread
> _run.c", line 130, function "pthread__next"
> zsh: abort (core dumped) PTHREAD_CONCURRENCY=8 ./thr
> njoly@thorgal [~]> PTHREAD_CONCURRENCY=7 ./thr
> main hello world
> assertion "next != 0" failed: file "/local/src/NetBSD/src/lib/libpthread/pthread
> _run.c", line 130, function "pthread__next"
> zsh: abort (core dumped) PTHREAD_CONCURRENCY=7 ./thr
> njoly@thorgal [~]> PTHREAD_CONCURRENCY=6 ./thr
> main hello world
> thread hello world
> assertion "next != 0" failed: file "/local/src/NetBSD/src/lib/libpthread/pthread
> _run.c", line 130, function "pthread__next"
> zsh: abort (core dumped) PTHREAD_CONCURRENCY=6 ./thr
> njoly@thorgal [~]> PTHREAD_CONCURRENCY=5 ./thr
> main hello world
> thread hello world
> njoly@thorgal [~]> PTHREAD_CONCURRENCY=4 ./thr
> main hello world
> thread hello world
> njoly@thorgal [~]> PTHREAD_CONCURRENCY=3 ./thr
> main hello world
> thread hello world
> njoly@thorgal [~]> PTHREAD_CONCURRENCY=2 ./thr
> main hello world
> thread hello world
> njoly@thorgal [~]> PTHREAD_CONCURRENCY=1 ./thr
> main hello world
> thread hello world
>
> This is a -current system from Nov. 7, running a GENERIC.MP kernel.
>
> The full dmesg has already been posted on NetBSD/amd64 mailing list:
> <URL:http://mail-index.netbsd.org/port-amd64/2005/12/01/0003.html>
>
> Thanks in advance,
> Regards.
>
>
>
> ------------------------------------------------------------------------
>
> #include <stdio.h>
>
> #include <pthread.h>
>
> void *thr_run(void *);
>
>
> int main(int argc, char **argv) {
> pthread_t thr;
>
> if (pthread_create(&thr, NULL, thr_run, NULL) != 0) {
> err(1, "pthread_create"); }
>
> (void)printf("main hello world\n");
>
> if (pthread_join(thr, NULL) != 0) {
> err(1, "pthread_join"); }
>
> return 0; }
>
>
> void *thr_run(void *arg) {
>
> (void)printf("thread hello world\n");
>
> return NULL; }
>
Hi
look here
http://mail-index.netbsd.org/tech-kern/2005/11/15/0012.html
Cheers
- --
There are 10 kinds of people in the world. Those who understand
binary numbers, and those who don't.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (NetBSD)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFDjyjl9Wt2FT7y228RAkmyAJ9YiMdWLyaObSAJTf+H/81rdmfE2QCfYt7P
kAY+Jin9si8O2LmQz259qTQ=
=lCOk
-----END PGP SIGNATURE-----