Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $null = File.open('/dev/null', 'w')
- threads = []
- max_threads = 5000
- loop do
- threads << Thread.new do
- str = 'x' * 500
- $null.write(str)
- end
- if threads.length >= max_threads
- threads.each { |t| t.join }
- threads = []
- end
- end
Add Comment
Please, Sign In to add comment