atexit
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 3
AtExit 2.01
AtExit is a Perl module that can perform exit processing for a program or object. more>>
AtExit is a Perl module that can perform exit processing for a program or object.
SYNOPSIS
use AtExit;
sub cleanup {
my @args = @_;
print "cleanup() executing: args = @argsn";
}
## Register subroutines to be called when this program exits
$_ = atexit(&cleanup, "This call was registered first");
print "first call to atexit() returned $_n";
$_ = atexit("cleanup", "This call was registered second");
print "second call to atexit() returned $_n";
$_ = atexit("cleanup", "This call shouldve been unregistered by rmexit");
rmexit($_) or warn "couldnt unregister exit-sub $_!";
if (@ARGV == 0) {
## Register subroutines to be called when this lexical scope is exited
my $scope1 = AtExit->new( &cleanup, "Scope 1, Callback 1" );
{
## Do the same for this nested scope
my $scope2 = AtExit->new;
$_ = $scope2->atexit( &cleanup, "Scope 2, Callback 1" );
$scope1->atexit( &cleanup, "Scope 1, Callback 2");
$scope2->atexit( &cleanup, "Scope 2, Callback 2" );
$scope2->rmexit($_) or warn "couldnt unregister exit-sub $_!";
print "*** Leaving Scope 2 ***n";
}
print "*** Finished Scope 2 ***n";
print "*** Leaving Scope 1 ***n";
}
print "*** Finished Scope 1 ***n" if (@ARGV == 0);
END {
print "*** Now performing program-exit processing ***n";
}
The AtExit module provides ANSI-C style exit processing modeled after the atexit function in the standard C library (see atexit(3C)). Various exit processing routines may be registered by calling atexit and passing it the desired subroutine along with any desired arguments. Then, at program-exit time, the subroutines registered with atexit are invoked with their given arguments in the reverse order of registration (last one registered is invoked first). Registering the same subroutine more than once will cause that subroutine to be invoked once for each registration.
An AtExit object can be created in any scope. When invoked as a function, atexit registers callbacks to be executed at program-exit time. But when invoked as an object-method (using the $object->method_name syntax), callbacks registered with an AtExit object are executed at object-destruction time! The rules for order of execution of the registered subroutines are the same for objects during object-destruction, as for the program during program-termination.
The atexit function/method should be passed a subroutine name or reference, optionally followed by the list of arguments with which to invoke it at program/object exit time. Anonymous subroutine references passed to atexit act as "closures" (which are described in perlref). If a subroutine name is specified (as opposed to a subroutine reference) then, unless the subroutine name has an explicit package prefix, it is assumed to be the name of a subroutine in the callers current package. A reference to the specified subroutine is obtained, and, if invocation arguments were specified, it is "wrapped up" in a closure which invokes the subroutine with the specified arguments. The resulting subroutine reference is added to the front of the list of exit-handling subroutines for the program (atexit) or the AtExit object ($exitObject->atexit) and the reference is then returned to the caller (just in case you might want to unregister it later using rmexit. If the given subroutine could not be registered, then the value zero is returned.
The rmexit function/method should be passed one or more subroutine references, each of which was returned by a previous call to atexit. For each argument given, rmexit will look in the list of exit-handling subroutines for the program (rmexit) or the AtExit object ($exitObject->rmexit) and remove the first matching entry from the list. If no arguments are given, then all program or object exit-handlers are unregistered! The value returned will be the number of subroutines that were successfully unregistered.
At object destruction time, the DESTROY{} subroutine in the AtExit module iterates over the subroutine references in the AtExit object and invokes each one in turn (each subroutine is removed from the front of the queue immediately before it is invoked). At program-exit time, the END{} block in the AtExit module iterates over the subroutines in the array returned by the exit_subs method and invokes each one in turn (each subroutine is removed from the front of the queue immediately before it is invoked). Note that in both cases (program-exit, and object-destruction) the subroutines in this queue are invoked in first-to-last order (the reverse order in which they were registered with atexit).
<<lessSYNOPSIS
use AtExit;
sub cleanup {
my @args = @_;
print "cleanup() executing: args = @argsn";
}
## Register subroutines to be called when this program exits
$_ = atexit(&cleanup, "This call was registered first");
print "first call to atexit() returned $_n";
$_ = atexit("cleanup", "This call was registered second");
print "second call to atexit() returned $_n";
$_ = atexit("cleanup", "This call shouldve been unregistered by rmexit");
rmexit($_) or warn "couldnt unregister exit-sub $_!";
if (@ARGV == 0) {
## Register subroutines to be called when this lexical scope is exited
my $scope1 = AtExit->new( &cleanup, "Scope 1, Callback 1" );
{
## Do the same for this nested scope
my $scope2 = AtExit->new;
$_ = $scope2->atexit( &cleanup, "Scope 2, Callback 1" );
$scope1->atexit( &cleanup, "Scope 1, Callback 2");
$scope2->atexit( &cleanup, "Scope 2, Callback 2" );
$scope2->rmexit($_) or warn "couldnt unregister exit-sub $_!";
print "*** Leaving Scope 2 ***n";
}
print "*** Finished Scope 2 ***n";
print "*** Leaving Scope 1 ***n";
}
print "*** Finished Scope 1 ***n" if (@ARGV == 0);
END {
print "*** Now performing program-exit processing ***n";
}
The AtExit module provides ANSI-C style exit processing modeled after the atexit function in the standard C library (see atexit(3C)). Various exit processing routines may be registered by calling atexit and passing it the desired subroutine along with any desired arguments. Then, at program-exit time, the subroutines registered with atexit are invoked with their given arguments in the reverse order of registration (last one registered is invoked first). Registering the same subroutine more than once will cause that subroutine to be invoked once for each registration.
An AtExit object can be created in any scope. When invoked as a function, atexit registers callbacks to be executed at program-exit time. But when invoked as an object-method (using the $object->method_name syntax), callbacks registered with an AtExit object are executed at object-destruction time! The rules for order of execution of the registered subroutines are the same for objects during object-destruction, as for the program during program-termination.
The atexit function/method should be passed a subroutine name or reference, optionally followed by the list of arguments with which to invoke it at program/object exit time. Anonymous subroutine references passed to atexit act as "closures" (which are described in perlref). If a subroutine name is specified (as opposed to a subroutine reference) then, unless the subroutine name has an explicit package prefix, it is assumed to be the name of a subroutine in the callers current package. A reference to the specified subroutine is obtained, and, if invocation arguments were specified, it is "wrapped up" in a closure which invokes the subroutine with the specified arguments. The resulting subroutine reference is added to the front of the list of exit-handling subroutines for the program (atexit) or the AtExit object ($exitObject->atexit) and the reference is then returned to the caller (just in case you might want to unregister it later using rmexit. If the given subroutine could not be registered, then the value zero is returned.
The rmexit function/method should be passed one or more subroutine references, each of which was returned by a previous call to atexit. For each argument given, rmexit will look in the list of exit-handling subroutines for the program (rmexit) or the AtExit object ($exitObject->rmexit) and remove the first matching entry from the list. If no arguments are given, then all program or object exit-handlers are unregistered! The value returned will be the number of subroutines that were successfully unregistered.
At object destruction time, the DESTROY{} subroutine in the AtExit module iterates over the subroutine references in the AtExit object and invokes each one in turn (each subroutine is removed from the front of the queue immediately before it is invoked). At program-exit time, the END{} block in the AtExit module iterates over the subroutines in the array returned by the exit_subs method and invokes each one in turn (each subroutine is removed from the front of the queue immediately before it is invoked). Note that in both cases (program-exit, and object-destruction) the subroutines in this queue are invoked in first-to-last order (the reverse order in which they were registered with atexit).
Download (0.008MB)
Added: 2007-05-23 License: Perl Artistic License Price:
884 downloads
Memory Allocation Checker 0.2.1
Memcheck provides the ability to fault on pointer overrun or freed pointer deference. more>>
Memcheck provides the ability to fault on pointer overrun (read or write) or freed pointer deference (read or write), logs double free and realloc of already freed pointers and memory not freed on exit, checks for pointer underrun on free and realloc, optionally reverses the behavior of overrun and underrun, "churns" reallocations to always return a different pointer, and logs pointer overruns instead of faulting.
It has a very small performance impact, with the tradeoff of a large memory footprint. It includes a validation test suite to verify correctness of the library. It is tested on a variety of architectures, including Alpha, ARM, HPPA, PPC, ix86, IA64, rs6000, S390, SPARC, and SPARC64.
It is tested on a variety of platforms, including OSF, FreeBSD, NetBSD, OpenBSD, Linux, HP/UX, Mac OSX, AIX, SCO, and Solaris.
Enhancements:
- Some missing backtraces were fixed.
- An atexit replacement was implemented to catch allocations that are freed by previously installed atexit handlers.
- Deeper backtraces are stored, and internal recursions are handled.
<<lessIt has a very small performance impact, with the tradeoff of a large memory footprint. It includes a validation test suite to verify correctness of the library. It is tested on a variety of architectures, including Alpha, ARM, HPPA, PPC, ix86, IA64, rs6000, S390, SPARC, and SPARC64.
It is tested on a variety of platforms, including OSF, FreeBSD, NetBSD, OpenBSD, Linux, HP/UX, Mac OSX, AIX, SCO, and Solaris.
Enhancements:
- Some missing backtraces were fixed.
- An atexit replacement was implemented to catch allocations that are freed by previously installed atexit handlers.
- Deeper backtraces are stored, and internal recursions are handled.
Download (0.32MB)
Added: 2006-07-11 License: GPL (GNU General Public License) Price:
1208 downloads
MPI Ruby 0.3
MPI Ruby is a Ruby binding of MPI. more>>
MPI Ruby is a Ruby binding of MPI. MPI Rubys primary goal in making this binding was to make the power of MPI available to Ruby users in a way that fits into the languages object oriented model.
In order to do this, the buffer and datatype management necessary in the C, C++, and Fortran bindings have been removed. What this means is that MPI Ruby allows you to treat objects as messages.
MPI Ruby also aims to be a complete binding to MPI in that it offers access to nearly all functionality of MPI. While there is not a one-to-one correspondence to functions and constants in the Ruby and C/C++/Fortran bindings, all of the communication and topology features are available.
There are fewer methods in the Ruby binding than there are functions in the C/C++/Fortran bindings, but this is mainly due to the fact that the programmer no longer needs to deal with buffers and datatypes.
Enhancements:
- examples/irecv.rb: Removed sleep from irecv example
- configure: Removed configure
- examples/Makefile.am: Added op example to Makefile
- examples/redsubmit.rb, examples/op.rb, examples/redhalt.rb, examples/red.rb:
New examples:
User-defined operations
Ruby Execution Daemon (red).
- src/ops.rb, src/main.c, src/mpi.c, src/mpi_comm.c, src/mpi_group.c, src/mpi_keyval.c, src/mpi_op.c, src/mpi_op_fns.c, src/mpi_request.c:
Fixed all of the rb_str_new2()s that were causing marshalling problems.
Fixed defines of singleton methods.
Fixed dims_create()
Now works with MPICH because of atexit(MPI_Finalize)
Set the MPI error handler
Fixed operators in MPI::Group (+ -> | and ^ -> &)
- examples/Makefile.am: New examples.
- docs/rd/mpi_group.rd, docs/rd/mpi_keyval.rd, docs/rd/mpi_op.rd, docs/rd/mpi_ruby.rd, docs/rd/mpi_comm.rd, docs/man/man3/Makefile.am, docs/man/man3/mpi_comm.3, docs/man/man3/MPI_Ruby.3, docs/man/man3/MPI_Status.3, docs/man/man3/MPI_Exception.3, docs/man/man3/MPI_Group.3, docs/man/man3/MPI_Keyval.3, docs/man/man3/MPI_Op.3, docs/man/man3/MPI_Request.3, docs/man/man3/MPI_Comm.3:
Doc updates to reflect fixes to singleton methods in several classes.
Typos fixed.
- docs/man/man1/mpi_ruby.1, docs/man/man1/Makefile.am:
Short doc on the interpreter itself (how to run)
- docs/man/Makefile.am: Added man1
- docs/html/index.html, docs/html/mpi_comm.html, docs/html/mpi_group.html, docs/html/mpi_keyval.html, docs/html/mpi_op.html, docs/html/mpi_ruby.html:
Doc updates to reflect fixes to singleton methods in several classes.
Typos fixed.
- configure, configure.in: Bumped to 0.3
Added man1/Makefile to output
<<lessIn order to do this, the buffer and datatype management necessary in the C, C++, and Fortran bindings have been removed. What this means is that MPI Ruby allows you to treat objects as messages.
MPI Ruby also aims to be a complete binding to MPI in that it offers access to nearly all functionality of MPI. While there is not a one-to-one correspondence to functions and constants in the Ruby and C/C++/Fortran bindings, all of the communication and topology features are available.
There are fewer methods in the Ruby binding than there are functions in the C/C++/Fortran bindings, but this is mainly due to the fact that the programmer no longer needs to deal with buffers and datatypes.
Enhancements:
- examples/irecv.rb: Removed sleep from irecv example
- configure: Removed configure
- examples/Makefile.am: Added op example to Makefile
- examples/redsubmit.rb, examples/op.rb, examples/redhalt.rb, examples/red.rb:
New examples:
User-defined operations
Ruby Execution Daemon (red).
- src/ops.rb, src/main.c, src/mpi.c, src/mpi_comm.c, src/mpi_group.c, src/mpi_keyval.c, src/mpi_op.c, src/mpi_op_fns.c, src/mpi_request.c:
Fixed all of the rb_str_new2()s that were causing marshalling problems.
Fixed defines of singleton methods.
Fixed dims_create()
Now works with MPICH because of atexit(MPI_Finalize)
Set the MPI error handler
Fixed operators in MPI::Group (+ -> | and ^ -> &)
- examples/Makefile.am: New examples.
- docs/rd/mpi_group.rd, docs/rd/mpi_keyval.rd, docs/rd/mpi_op.rd, docs/rd/mpi_ruby.rd, docs/rd/mpi_comm.rd, docs/man/man3/Makefile.am, docs/man/man3/mpi_comm.3, docs/man/man3/MPI_Ruby.3, docs/man/man3/MPI_Status.3, docs/man/man3/MPI_Exception.3, docs/man/man3/MPI_Group.3, docs/man/man3/MPI_Keyval.3, docs/man/man3/MPI_Op.3, docs/man/man3/MPI_Request.3, docs/man/man3/MPI_Comm.3:
Doc updates to reflect fixes to singleton methods in several classes.
Typos fixed.
- docs/man/man1/mpi_ruby.1, docs/man/man1/Makefile.am:
Short doc on the interpreter itself (how to run)
- docs/man/Makefile.am: Added man1
- docs/html/index.html, docs/html/mpi_comm.html, docs/html/mpi_group.html, docs/html/mpi_keyval.html, docs/html/mpi_op.html, docs/html/mpi_ruby.html:
Doc updates to reflect fixes to singleton methods in several classes.
Typos fixed.
- configure, configure.in: Bumped to 0.3
Added man1/Makefile to output
Download (0.12MB)
Added: 2006-05-31 License: Freely Distributable Price:
1242 downloads
Secleted [ 0 ] software to compare
- Page: 1 of 1
- 1
Copyright Notice:
Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future software development. The above atexit search only lists software in full, demo and trial versions for free download. Download links are directly from our mirror sites or publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed