Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^5: Recursion: the Towers of Hanoi problem

by abitkin (Monk)
on Oct 25, 2004 at 14:38 UTC ( #402234=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub a{if(my$l=pop){a(@_[0,2,1],$l-1);print"Move disc $l from $_[0] to 
    +$_[2]
    ";a(@_[1,0,2],$l-1);}}a 'A'..'C',pop;
    
  2. or download this
    sub a{my$l=pop;a(@_[0,2,1],--$l)."Move disc $l from $_[0] to $_[2]
    ".a(@_[1,0,2],$l)if$l>0;}print a 'A'..'C',pop;
    
  3. or download this
    sub a{if(my$l=pop){a(@_[0,2,1],--$l);print"Move disc $l from $_[0] to 
    +$_[2]
    ";a(@_[1,0,2],$l);}}a 'A'..'C',pop;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://402234]
help
Chatterbox?
[marioroy]: ... including MCE 1.830. Finally, reached the finish line. All is well.
[marioroy]: The issue on the Windows platform is many workers loading "required" modules simultaneously, more so with XS modules.
[marioroy]: ... at runtime.
[marioroy]: The other problem is if a module isn't thread or multi-process safe, there's no posix_exit equivalent on the Windows platform without exiting the entire script.
[Discipulus]: and the workaround you proposed works better? ie load them once and then copy them for threads?
[Discipulus]: ah this is another interesting point: how to know if a module is or is not thread safe?
[Discipulus]: .. sorry mario if i'm bothering you at 5:46
[choroba]: Some modules mention their thread safety in the documentation
[choroba]: if they don't, it's safer to asume they aren't safe

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (8)
As of 2017-09-22 09:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (260 votes). Check out past polls.

    Notices?