Gentoo Archives: gentoo-amd64

From: Greg <journey@×××××××××××××××.net>
To: gentoo-amd64@l.g.o
Subject: Re: [gentoo-amd64] Hyper-threading an AMD64 3800+
Date: Wed, 10 Jun 2009 22:35:18
Message-Id: 200906102235.n5AMZDf5018538@raven.ontheside.net
In Reply to: Re: [gentoo-amd64] Hyper-threading an AMD64 3800+ by Greg
1 One final thought / question / observation along the same lines...
2
3 This is what got me started on this line of thinking / research...
4
5 I have experimented with posix threads and find repeatedly that even a multi-threaded application yields results the same
6 as if I have coded a non-multi-threaded application.
7
8 If I need to give examples, I shall later, but basicly, I code with pthreads.h in C a simple counting thread which reports
9 its thread number and the count. I then set main to spawn multiple threads, and in the threads, each has a random sleep in
10 between printfs to show the thread / count.
11
12 I even put in flushes to make sure the results weren't due to a printf buffering issue.
13
14 Each and every result was of a thread counting in sequence before going to the next thread. No sleep states were put in
15 the main program. It simple spawned a bunch of threads back to back, and then waited for them to "join".
16
17 Is this normal? I thought even under a uniprocessor machine the threads were to time-slice like on a multicore.

Replies

Subject Author
[gentoo-amd64] Re: Hyper-threading an AMD64 3800+ Nikos Chantziaras <realnc@×××××.de>
Re: [gentoo-amd64] Hyper-threading an AMD64 3800+ Hung Dang <hungptit@×××××.com>