Re: Improve hackbench

Zhang, Yanmin
2008-01-07T01:30:29Z

On Fri, 2008-01-04 at 07:44 -0500, Lee Revell wrote:
> On Jan 4, 2008 3:10 AM, Ingo Molnar <mingo@elte.hu> wrote:
> > http://redhat.com/~mingo/cfs-scheduler/tools/hackbench.c
> >
>
> Why not lose the #ifdef and just use PTHREAD_STACK_MIN?
That's a good idea.

Thanks,
-yanmin

---

--- hackbench.c.orig 2008-01-10 08:24:36.000000000 +0800
+++ hackbench.c 2008-01-10 08:25:12.000000000 +0800
@@ -151,10 +151,8 @@ pthread_t create_worker(void *ctx, void
if (pthread_attr_init(&attr) != 0)
barf("pthread_attr_init:");

-#ifndef __ia64__
- if (pthread_attr_setstacksize(&attr, (size_t)(16*1024)) != 0)
+ if (pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN) != 0)
barf("pthread_attr_setstacksize");
-#endif

if ((err=pthread_create(&childid, &attr, func, ctx)) != 0) {
fprintf(stderr, "pthread_create failed: %s (%d)\n", strerror(err), err);