diff options
author | Stefano Lattarini <stefano.lattarini@gmail.com> | 2012-07-26 22:14:59 +0200 |
---|---|---|
committer | Stefano Lattarini <stefano.lattarini@gmail.com> | 2012-07-31 04:39:18 +0200 |
commit | c0012b0230754ce6d1d42c2e85d9787bf5bd9e30 (patch) | |
tree | a0fb0654402d12d1cf787fe4d5becf53f82cd6d2 /lib/Automake/Location.pm | |
parent | 53b5d112dcdad674b5ea4a85b9ce2401b1023291 (diff) | |
download | automake-c0012b0230754ce6d1d42c2e85d9787bf5bd9e30.tar.gz |
[ng] automake: remove support for threaded execution
Why are we removing such a nice feature, especially in a world where
multicore systems are becoming the norm?
First, that feature adds a lot of complexity to the Automake script,
which might get in the way of future refactorings. And the Automake-NG
fork is about refactorings and cleanups at least as much as about new
features and better GNU make integration.
Also, the performance enhancements offered by threaded Automake seem
to be fairly limited:
<http://lists.gnu.org/archive/html/automake/2009-11/msg00004.html>
albeit admittedly not excessively so:
<http://www.open-mpi.org/community/lists/devel/2010/09/8524.php>
In addition, we should really be pushing peoples towards non-recursive
build systems -- refer to Peter Miller's article "Recursive Make
Considered Harmful" <http://miller.emu.id.au/pmiller/books/rmch/>.
In such a non-recursive setup, there is just just one 'Makefile.am',
and thus little point in trying to launch a thread for each
'Makefile.am'.
In the end, however, the consideration that tipped the balance in favor
of this change is that we want to reach a point, during the yet-to-come
maturity of Automake-NG, where the 'automake' script will be just a thin
layer around the provided helper scripts and makefile fragments (with
maybe a *small* smattering of preprocessing), as well as around autom4te
(for the proper parsing of configure.ac). At such a point, a threaded
execution would bring no real benefit.
* NG-NEWS: Update.
* doc/automake-ng.texi, NG-NEWS: Likewise.
* configure.ac: Don't check for 'ithreads' support in perl.
Drop AC_SUBST 'PERL_THREADS'.
* bootstrap.sh (PERL_THREADS): Don't define.
(dosubst): Don't substitute it.
* lib/Automake/Config.in ($perl_threads): Define no more.
(@EXPORT): Drop it.
* aclocal.in ($perl_threads): Remove, no more needed.
* automake.in (BEGIN) [$perl_threads]: Don't require nor import
the 'threads' and 'Thread::Queue' modules.
(QUEUE_MESSAGE, QUEUE_CONF_FILE, QUEUE_LOCATION, QUEUE_STRING):
Delete constants.
($required_conf_file_queue): Delete variable.
($nthreads): Likewise, and thus ...
(get_number_of_threads): ... delete this function, whose only
purpose was to initialize that variable.
(handle_makefiles_serial): Delete, its body inlined in the main
code.
(require_file_internal): Don't take the '$QUEUE' argument, nor
handle threading/serialization calling back ...
(queue_required_file_check_or_copy): ... this function, which
has thus been removed.
(require_libsource_with_macro): Adjust 'require_file_internal'
call to new signature.
(require_conf_file): Likewise, in the process dropping any
handling of threading/serialization.
(handle_makefiles_threaded): This is no more called anywhere,
so delete it, together with ...
(require_queued_file_check_or_copy): ... this, which has in
that its only caller.
* lib/Automake/Location.pm (serialize, deserialize): Delete
as unused.
* lib/Automake/Channels.pm (setup_channel_queue,
pop_channel_queue): Likewise.
(@EXPORT): Adjust.
(BEGIN) [$perl_threads]: Don't require nor import 'threads'.
(%_default_options): Remove 'ordered', 'queue' and 'queue_key'
keys, that were only required for serialization during threaded
Automake.
(_merge_options, _print_message): No need to handle those
options.
Adjust creation of channels 'automake', 'verb' and 'fatal'.
(_enqueue, _dequeue): Delete as unused.
(msg): Adjust a comment.
(verb): Don't try to display informations about the current
thread.
* lib/Automake/DisjConditions.pm (CLONE): Delete, no more
needed.
* t/ax/am-test-lib.sh (require_tool): Drop handing of
requirement 'perl-threads'; it is not used by any test now.
* t/parallel-am.sh: Remove as obsolete.
* t/parallel-am2.sh: Likewise.
* t/parallel-am3.sh: Likewise.
* t/pm/Condition-t.pl: Likewise.
* t/pm/DisjConditions-t.pl: Likewise.
* t/werror3.sh: Don't test with AUTOMAKE_JOBS=2.
* Makefile.am (check-coverage-run, recheck-coverage-run): Don't
export 'WANT_NO_THREADS' to "yes", nor unset 'AUTOMAKE_JOBS'.
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Diffstat (limited to 'lib/Automake/Location.pm')
-rw-r--r-- | lib/Automake/Location.pm | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/lib/Automake/Location.pm b/lib/Automake/Location.pm index 290db73fe..28d1a3884 100644 --- a/lib/Automake/Location.pm +++ b/lib/Automake/Location.pm @@ -59,13 +59,6 @@ Automake::Location - a class for location tracking, with a stack of contexts # that would otherwise be modified. my $where_copy = $where->clone; - # Serialize a Location object (for passing through a thread queue, - # for example) - my @array = $where->serialize (); - - # De-serialize: recreate a Location object from a queue. - my $where = new Automake::Location::deserialize ($queue); - =head1 DESCRIPTION C<Location> objects are used to keep track of locations in Automake, @@ -207,46 +200,6 @@ sub dump ($) return $res; } -=item C<@array = $location-E<gt>serialize> - -Serialize a Location object (for passing through a thread queue, -for example). - -=cut - -sub serialize ($) -{ - my ($self) = @_; - my @serial = (); - push @serial, $self->get; - my @contexts = $self->get_contexts; - for my $pair (@contexts) - { - push @serial, @{$pair}; - } - push @serial, undef; - return @serial; -} - -=item C<new Automake::Location::deserialize ($queue)> - -De-serialize: recreate a Location object from a queue. - -=cut - -sub deserialize ($) -{ - my ($queue) = @_; - my $position = $queue->dequeue (); - my $self = new Automake::Location $position; - while (my $position = $queue->dequeue ()) - { - my $context = $queue->dequeue (); - push @{$self->{'contexts'}}, [$position, $context]; - } - return $self; -} - =back =head1 SEE ALSO |