This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Summary: In MRI 1.9, if you keep threads in an array in a local variable, the threads may outlive the local variable. | |
# I have not yet been able to produce a scenario in which the threads are ever garbage-collected. | |
# You have to remove the thread from the array before it goes out of scope, e.g. using #pop or #clear. | |
# INPUT DESIRED: If anyone can demonstrate a condition in which a local array keeps threads and those threads are eventually GC'd. | |
# INPUT DESIRED: Is this expected behavior or a bug? | |
# NOTE: This test will not work as expected in JRuby, because its garbage collection works differently. Whether the same behavior exists in JRuby is an exercise for someone smarter than I am. | |
class Foo | |
THREAD_PROC = lambda{ (0..10).to_a.map do Foo.new end } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var countries = { | |
'af' : 'Afganistan', | |
'de' : 'Almanya', | |
'ad' : 'Andorra', | |
'ao' : 'Angola', | |
'ag' : 'Antigua ve Barbuda', | |
'ar' : 'Arjantin', | |
'al' : 'Arnavutluk', | |
'aw' : 'Aruba', | |
'au' : 'Avustralya', |