Hi,

Applying this patch changes the for loops using autoconf into parallel for 
loops calling autoconf.
It reduced the time to run bootstrap from ~9:30 to ~2:45
It's limited to 10 sub shells working in parallel though...
I only checked that hello.exe and ticker.exe ran on sparc-rtems4.11-gdb...

Thanks!
Cindy
________________________________________
From: rtems-devel-boun...@rtems.org [rtems-devel-boun...@rtems.org] on behalf 
of Sebastian Huber [sebastian.hu...@embedded-brains.de]
Sent: Thursday, August 01, 2013 11:38 PM
To: Ashi
Cc: rtems-devel@rtems.org
Subject: Re: [PATCH] posix: Reimplement POSIX Key manager to use a red-black 
tree.

On 2013-08-02 03:03, Ashi wrote:
>
>         +  /** This field points to parent freechain node */
>         +  POSIX_Keys_Freechain_node *fc_node_ptr;
>
>
>     I don't think we need this fc_node_ptr.
>
> Do you mean use a 'Container' macro instead?

Not necessarily, see below.

>
>
>         +  /** This field is the POSIX key used as an rbtree key */
>         +  pthread_key_t key;
>         +  /** This field is the Thread id also used as an rbtree key */
>         +  Objects_Id thread_id;
>         +  /** This field points to the POSIX key value of specific thread */
>         +  void *value;
>         +}  POSIX_Keys_Rbtree_node;
>
>
>     I would call this POSIX_Keys_Key_value_pair.
>
>         +
>         +/**
>         + * @brief POSIX_Keys_Freechain is used in Freechain structure
>         + */
>         +typedef struct {
>         +    Freechain_Control super_fc;
>         +    size_t bump_count;
>         +} POSIX_Keys_Freechain;
>         +
>         +/**
>         + * @brief POSIX_Keys_Freechain_node is freechain node
>         + */
>         +struct POSIX_Keys_Freechain_node___struct {
>         +  Chain_Node ch_node;
>         +  POSIX_Keys_Rbtree_node rb_node;
>         +};
>
>
>     Why not use POSIX_Keys_Rbtree_node directly?
>
> Since every freechain node needs a Chain_Node in its first field. There is a
> Chain_Node in  POSIX_Keys_Rbtree_node, but it is used in each thread's key
> value chain. So I add a Chain_Node to POSIX_Keys_Rbtree_node.

The key value pairs on the free chain are unused, thus not part of other data
structures.  So basically you can cast an unused object to any type provided it
has enough storage.

--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.hu...@embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
_______________________________________________
rtems-devel mailing list
rtems-devel@rtems.org
http://www.rtems.org/mailman/listinfo/rtems-devel
From f83df8931b4be4d0fb58670671723d0cf51e3d95 Mon Sep 17 00:00:00 2001
From: Cynthia Rempel <cynt6...@vandals.uidaho.edu>
Date: Thu, 1 Aug 2013 23:42:30 -0700
Subject: [PATCH] Parallelize calls to autoconf

---
 bootstrap | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/bootstrap b/bootstrap
index 4226313..0cf47f4 100755
--- a/bootstrap
+++ b/bootstrap
@@ -144,8 +144,9 @@ generate)
   esac
 
   confs=`find . \( -name 'configure.in' -o -name 'configure.ac' \) -print`
+  n_confs=0
   for i in $confs; do
-  dir=`dirname $i`
+  ( dir=`dirname $i`
   configure=`basename $i`
   ( test "$quiet" = "true" || echo "$dir"
     cd $dir
@@ -164,7 +165,10 @@ generate)
     ${AUTOCONF}
     test -f Makefile.am && test -n "`grep 'stamp-h\.in' Makefile.in`" \
       && echo timestamp > stamp-h.in
-  )
+  )) &
+  n_confs=$((n_confs+1))
+  n_confs=$((n_confs%10))
+  if [ "$n_confs" -eq 0 ] ; then wait; fi # Limit to 10 concurrent subshells.
   done
   ;;
 
@@ -176,8 +180,9 @@ autoreconf)
   fi
 
   confs=`find . -name 'configure.ac' -print`
+  n_reconfs=0
   for i in $confs; do
-  dir=`dirname $i`
+  (dir=`dirname $i`
   configure=`basename $i`
   ( test "$quiet" = "true" || echo "$dir"
     cd $dir
@@ -186,7 +191,10 @@ autoreconf)
     ${AUTORECONF} -i --no-recursive $verbose
     test -f Makefile.am && test -n "`grep 'stamp-h\.in' Makefile.in`" \
       && echo timestamp > stamp-h.in
-  )
+  ))&
+  n_reconfs=$((n_reconfs+1))
+  n_reconfs=$((n_reconfs%10))
+  if [ "$n_reconfs" -eq 0 ] ; then wait; fi # Limit to 10 concurrent subshells.
   done
   ;;
 
@@ -260,5 +268,5 @@ clean)
   find . -name 'autom4te*.cache' | xargs rm -rf
   ;;
 esac
-
+wait # clear the buffer before exiting
 exit 0
-- 
1.8.1.2

_______________________________________________
rtems-devel mailing list
rtems-devel@rtems.org
http://www.rtems.org/mailman/listinfo/rtems-devel

Reply via email to