Bug #12661
closedMultithreading http get doesn't work
Description
Hi, I was making this script that was supposed to download all files from my favourite imageboard (2ch.hk)
Everything was normal until I tried to make downloading of these files asynchronous, i.e. in different threads, to improve speed
I tried running this
http://ideone.com/k2l4Hm
but it never works (because of 16th line I suppose)
And sometimes a huge report comes up in my terminal saying that I may have encountered a bug in Ruby
So I decided to write about it here
(the program may not work if the thread was deleted. if that happened, try to take one thread from 2ch.hk/b)
Updated by orotti (Tim N) over 8 years ago
Updated by rhenium (Kazuki Yamaguchi) over 8 years ago
- Status changed from Open to Rejected
You can't make multiple requests on a Net::HTTP instance at the same time. You have to open an HTTP connection for each thread.
As for the segmentation fault, in trunk, r55100 should have fixed it ([Bug #12292]).
Updated by rhenium (Kazuki Yamaguchi) about 8 years ago
- Is duplicate of Bug #12292: Race between OpenSSL::SSL::SSLSocket#stop and #connect can cause a segmentation fault added