<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8988607852659582768</id><updated>2011-08-05T01:29:40.161+09:00</updated><category term='ruby'/><category term='openssl'/><category term='ruby http'/><category term='jruby'/><category term='httpclient'/><title type='text'>road to soap4r</title><subtitle type='html'>&lt;a href="http://www.ruby-lang.org/"&gt;Ruby&lt;/a&gt;, &lt;a href="http://jruby.org/"&gt;JRuby&lt;/a&gt;, &lt;a href="http://github.com/jruby/jruby-ossl"&gt;jruby-ossl&lt;/a&gt; and Network Security</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://soap4r.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8988607852659582768/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://soap4r.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>NaHi</name><uri>http://www.blogger.com/profile/15802206116733407994</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8988607852659582768.post-224108019490101008</id><published>2011-04-11T17:41:00.007+09:00</published><updated>2011-04-14T23:02:49.001+09:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby http'/><title type='text'>Feature matrix of Ruby HTTP clients</title><content type='html'>&lt;div&gt;I posted &lt;a href="http://j.mp/RubyHTTPClients"&gt;Ruby HTTP clients feature matrix&lt;/a&gt; which compares various Ruby HTTP client implementations, as a product of &lt;a href="http://qwik.jp/asakusarb/"&gt;Asakusa.rb&lt;/a&gt; meetups. I hope Ruby users find it informative.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Listed clients: net/http, open-uri, httparty, rest-client, right_http_connection, rufus-verbs, simplehttp, curb, patron, typhoeus, eventmachine, excon, httpclient, faraday, wrest, activeresource and rfuzz.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Sample and test scripts for this matrix is at &lt;a href="https://github.com/asakusarb/odrk-http-client"&gt;github repo&lt;/a&gt;. Let me know if you find any mistakes (it must include some!) and my misunderstandings.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This matrix is a part of my presentation &lt;a href="http://j.mp/OdrkHTTPClient"&gt;Oedo HTTP client picture scroll&lt;/a&gt; at &lt;a href="http://regional.rubykaigi.org/oedo01"&gt;Oedo RubyKaigi01(in Japanese)&lt;/a&gt; hosted by Asakusa.rb yesterday. You can see other comparisons including dependency, timeline and performance in the presentation. There are some Japanese commentary in it but almost major parts are in English and images.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;[EDIT]&lt;/div&gt;&lt;div&gt;&lt;div&gt;Disclaimer: I'm the author of httpclient gem, which is one of a clients in the list. :)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here's Summary in &lt;a href="http://j.mp/OdrkHTTPClient"&gt;the presentation&lt;/a&gt;:&lt;/div&gt;&lt;div&gt; - net/http has various derivatives and alternatives because of old-style API and simple structure.&lt;/div&gt;&lt;div&gt; - Few derivatives of net/http offers full-features of net/http. Too simple to extend?&lt;/div&gt;&lt;div&gt; - Implemented features are vary from product to product.&lt;/div&gt;&lt;div&gt; - APIs are vary, too. Making simple API tends to introduce disunity.&lt;/div&gt;&lt;div&gt; - There's no performance difference between products but it's worth checking Keep-Alive and gzip compression support.&lt;/div&gt;&lt;div&gt; - Eventmachine is considerably fast, if you can do non-blocking all your code.&lt;/div&gt;&lt;div&gt; - Take care if you use C-ext libcurl variants. Some introduce interpreter blocking and JRuby/Rubinius incompatibility (at this moment).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And if you need SSL support, clients you can use are not much.&lt;/div&gt;&lt;div&gt;[/EDIT]&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Have fun!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8988607852659582768-224108019490101008?l=soap4r.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://soap4r.blogspot.com/feeds/224108019490101008/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8988607852659582768&amp;postID=224108019490101008' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8988607852659582768/posts/default/224108019490101008'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8988607852659582768/posts/default/224108019490101008'/><link rel='alternate' type='text/html' href='http://soap4r.blogspot.com/2011/04/feature-matrix-of-ruby-http-clients.html' title='Feature matrix of Ruby HTTP clients'/><author><name>NaHi</name><uri>http://www.blogger.com/profile/15802206116733407994</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8988607852659582768.post-1390577137266299113</id><published>2010-11-04T14:50:00.006+09:00</published><updated>2010-11-04T17:19:24.077+09:00</updated><title type='text'>JRuby-OSSL (JRuby-OpenSSL) 0.7.2 released</title><content type='html'>&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="line-height: 20px; font-size: medium;"&gt;JRuby-OSSL 0.7.2 is out.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-size: medium; line-height: 20px; "&gt;&lt;a href="http://rubygems.org/gems/jruby-openssl"&gt;http://rubygems.org/gems/jruby-openssl&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-size: medium; line-height: 20px; "&gt;&lt;a href="http://github.com/jruby/jruby-ossl/blob/master/History.txt"&gt;http://github.com/jruby/jruby-ossl/blob/master/History.txt&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="line-height: 20px; font-size: medium;"&gt;It contains fixes for important SSL resource management issues; selector/file descriptor leak and timeout did not work.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-size: medium; line-height: 20px; "&gt;&lt;a href="http://bugs.jruby.org/5018"&gt;JRUBY-5018&lt;/a&gt; SSLSocket holds selectors, keys, preventing quick cleanup of resources when dereferenced&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-size: medium; line-height: 20px; "&gt;&lt;a href="http://bugs.jruby.org/5059"&gt;JRUBY-5059&lt;/a&gt; Timeouts don't work correctly for https sessions&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="line-height: 20px; font-size: medium;"&gt;SSL users are recommended to upgrade to 0.7.2.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="line-height: 20px; font-size: medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: medium; line-height: 20px; "&gt;Other fixes are;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-size: medium; line-height: 20px; "&gt;&lt;a href="http://bugs.jruby.org/5024"&gt;JRUBY-5024&lt;/a&gt; HMAC.new with digest name raises an Exception; Now HMAC.new(msg, "SHA1") works as same as HMAC.new(msg, Digest::SHA1.new)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-size: medium; line-height: 20px; "&gt;&lt;a href="http://bugs.jruby.org/5023"&gt;JRUBY-5023&lt;/a&gt; Certificate#signature_algorithm returns wrong name; Now it returns "md5WithRSAEncryption", "sha1WithRSAEncryption", "dsaWithSHA1" or "dsaWithSHA2" instead of "SHA1" or "SHA2".&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-size: medium; line-height: 20px; "&gt;&lt;a href="http://bugs.jruby.org/5096"&gt;JRUBY-5096&lt;/a&gt; Inconsistent verification behavior; Caling Certificate#verify twice returns true and false for valid certificate.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-size: medium; line-height: 20px; "&gt;&lt;a href="http://bugs.jruby.org/4965"&gt;JRUBY-4965&lt;/a&gt; OpenSSL::Config not implemented; Now you can use OpenSSL::Config for parsing openssl.cnf&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-size: medium; line-height: 20px; "&gt;&lt;a href="http://bugs.jruby.org/5060"&gt;JRUBY-5060&lt;/a&gt; x509store.PEMInputOutput.writeX509Request causes NullPointerException; Avoid NPE from to_pem for empty X509 Objects&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-size: medium; line-height: 20px; "&gt;&lt;a href="http://bugs.jruby.org/5125"&gt;JRUBY-5125&lt;/a&gt; Cipher#name should return SN(short name) of OpenSSL (uppercase in general); Now Cipher#name for arcfour is 'RC4' not 'rc4' for Net::SSH compatibility.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-size: medium; line-height: 20px; "&gt;&lt;a href="http://bugs.jruby.org/5126"&gt;JRUBY-5126&lt;/a&gt; Cipher#reset should not reset the internal state for stream cipher; Net::SSH depends on this behavior.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="line-height: 20px; font-size: medium;"&gt;Net::SSH users are also recommended to upgrade.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="line-height: 20px; font-size: medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="line-height: 20px; font-size: medium;"&gt;This release supports following environments. (Not changed from 0.7.1)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-size: medium; line-height: 20px; "&gt;JRuby 1.5.3 and 1.4.0 (1.5.X should run fine, too)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-size: medium; line-height: 20px; "&gt;JRE 6 and 5&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-size: medium; line-height: 20px; "&gt;With or without Unlimited Strength policy files for JRE&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-size: medium; line-height: 20px; "&gt;Any OS which runs above JRE (I tested against Ubuntu 10.10 and Windows 7)&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div style="line-height: 20px; font-size: medium; "&gt;Please file a ticket at &lt;a href="http://bugs.jruby.org"&gt;http://bugs.jruby.org&lt;/a&gt; with 'Component: OpenSSL' when you find a problem with this release.&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8988607852659582768-1390577137266299113?l=soap4r.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://soap4r.blogspot.com/feeds/1390577137266299113/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8988607852659582768&amp;postID=1390577137266299113' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8988607852659582768/posts/default/1390577137266299113'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8988607852659582768/posts/default/1390577137266299113'/><link rel='alternate' type='text/html' href='http://soap4r.blogspot.com/2010/11/jruby-ossl-jruby-openssl-072-released.html' title='JRuby-OSSL (JRuby-OpenSSL) 0.7.2 released'/><author><name>NaHi</name><uri>http://www.blogger.com/profile/15802206116733407994</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8988607852659582768.post-6427447166514010481</id><published>2010-08-04T20:32:00.004+09:00</published><updated>2010-08-04T21:04:54.718+09:00</updated><title type='text'>JRuby-OSSL (JRuby-OpenSSL) 0.7.1 released</title><content type='html'>JRuby-OSSL 0.7.1 is out.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://rubygems.org/gems/jruby-openssl"&gt;http://rubygems.org/gems/jruby-openssl&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://github.com/jruby/jruby-ossl/blob/master/History.txt"&gt;http://github.com/jruby/jruby-ossl/blob/master/History.txt&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;It's not a big release like 0.7. Mainly fixing 1 HTTPS client bug.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://bugs.jruby.org/4826"&gt;JRUBY-4826&lt;/a&gt; - net/https client possibly raises "rbuf_fill': End of file reached (EOFError)" for HTTP chunked read.&lt;/li&gt;&lt;/ul&gt;And misc changes.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://bugs.jruby.org/4900"&gt;JRUBY-4900&lt;/a&gt; - Set proper String to OpenSSL::OPENSSL_VERSION. Make sure it's not an OpenSSL artifact: "OpenSSL 0.9.8b 04 May 2006 (JRuby-OpenSSL fake)" -&gt; "jruby-ossl 0.7.1"&lt;/li&gt;&lt;li&gt;&lt;a href="http://bugs.jruby.org/4975"&gt;JRUBY-4975&lt;/a&gt; - Moving BouncyCastle jars out to its own gem.&lt;/li&gt;&lt;/ul&gt;That's all. Much thanks to bug reporters of &lt;a href="http://bugs.jruby.org/4826"&gt;JRUBY-4826&lt;/a&gt; and &lt;a href="http://bugs.jruby.org/4822"&gt;JRUBY-4822&lt;/a&gt; (considered as the same issue) for helping us to fix this bug.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;NOTE: Now BouncyCastle jars has moved out to its own gem "bouncy-castle-java" (&lt;a href="http://rubygems.org/gems/bouncy-castle-java"&gt;http://rubygems.org/gems/bouncy-castle-java&lt;/a&gt;).  You don't need to care about it because "jruby-openssl" gem depends on it from now on.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You can uninstall "bouncy-castle-java" gem if you certainly know that you don't need BouncyCastle jar for your JRuby-OSSL usage.  For example, Random, Digest, HMAC and Cipher does not depend on BC jars from 0.7. And take care about "bouncy-castle-java" gem is distributed under the same terms as BouncyCastle's license.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;One more thing at the end. We changed the artifact name to JRuby-OSSL for clearing that it is not using/distributing OpenSSL Toolkit itself.  JRuby-OSSL just includes some derived work from software developed by the OpenSSL Project in the OpenSSL Toolkit. (&lt;a href="http://www.openssl.org/"&gt;http://www.openssl.org/&lt;/a&gt;)  And we keep the name 'jruby-openssl' at some point like gem name for avoiding users confusion.  It's a cosmetic change and there's no change other than that.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Enjoy!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8988607852659582768-6427447166514010481?l=soap4r.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://soap4r.blogspot.com/feeds/6427447166514010481/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8988607852659582768&amp;postID=6427447166514010481' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8988607852659582768/posts/default/6427447166514010481'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8988607852659582768/posts/default/6427447166514010481'/><link rel='alternate' type='text/html' href='http://soap4r.blogspot.com/2010/08/jruby-ossl-071-released.html' title='JRuby-OSSL (JRuby-OpenSSL) 0.7.1 released'/><author><name>NaHi</name><uri>http://www.blogger.com/profile/15802206116733407994</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8988607852659582768.post-7465346019364479558</id><published>2010-07-30T20:24:00.001+09:00</published><updated>2010-07-30T20:27:22.159+09:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jruby'/><title type='text'>JRubyKaigi2010</title><content type='html'>&lt;div&gt;I'll give a 20min. session talk on &lt;a href="http://j.rubykaigi.org/2010"&gt;JRubyKaigi2010&lt;/a&gt;. (smart URL, isn't it?)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;"JRuby Hacking Guide" - Aims; extracting what is where in JRuby source code, showing how those interacts when, and hacking/troubleshooting it by examples in 20 min.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Date: 8/28(Sat.) 13:00-18:00 (on the second day in RubyKaigi2010)&lt;/div&gt;&lt;div&gt;More Details: &lt;a href="http://rubykaigi.tdiary.net/20100728.html#p02"&gt;http://rubykaigi.tdiary.net/20100728.html#p02&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;JRuby co-lead Charles O.Nutter and Thomas Enebo comes to Japan and have a Keynote. Can't wait to discuss with them including many Japanese developers who are interested in JRuby's future.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Are you planning to go RubyKaigi2010? Interested in JRuby's compilation details, optimization scheme and trouble shooting? See you there!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8988607852659582768-7465346019364479558?l=soap4r.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://soap4r.blogspot.com/feeds/7465346019364479558/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8988607852659582768&amp;postID=7465346019364479558' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8988607852659582768/posts/default/7465346019364479558'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8988607852659582768/posts/default/7465346019364479558'/><link rel='alternate' type='text/html' href='http://soap4r.blogspot.com/2010/07/jrubykaigi2010.html' title='JRubyKaigi2010'/><author><name>NaHi</name><uri>http://www.blogger.com/profile/15802206116733407994</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8988607852659582768.post-142869505361977679</id><published>2010-07-28T20:03:00.009+09:00</published><updated>2010-08-01T11:57:26.948+09:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby'/><title type='text'>Queue#pop is unfair in Ruby 1.9</title><content type='html'>&lt;div&gt;Do you think Queue is fair?&lt;/div&gt;&lt;br /&gt;&lt;div&gt;"Fairness" here is, when two or more threads wait with Queue#pop, the control is sequentially passed from the thread for which it waits longest when Queue#push is invoked.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;In this sense, Ruby 1.8 is "fair". Following script always dumps "[:go, :first]" for Ruby 1.8.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;# &lt;a href="http://gist.github.com/493930#file_gistfile1.rb"&gt;http://gist.github.com/493930#file_gistfile1.rb&lt;/a&gt;&lt;br /&gt;&lt;pre&gt;create_waiter = lambda { |name, command|&lt;br /&gt; t = Thread.new {&lt;br /&gt;   p [command.pop, name]&lt;br /&gt; }&lt;br /&gt; Thread.pass until t.status == 'sleep'&lt;br /&gt; t&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;50.times do&lt;br /&gt; command = Queue.new&lt;br /&gt; # create 3 waiters, and...&lt;br /&gt; create_waiter.call(:first, command)&lt;br /&gt; create_waiter.call(:second, command)&lt;br /&gt; create_waiter.call(:third, command)&lt;br /&gt; # and pushes a command.&lt;br /&gt; command.push(:go)&lt;br /&gt; # then try to consume the command by a subsequent thread&lt;br /&gt; Thread.new {&lt;br /&gt;   p [command.pop, :LATER]&lt;br /&gt; }&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;In contrast to this, Ruby 1.9 sometimes dumps "[:go, :LATER]" because Queue#pop became unfair from Ruby 1.9.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;To tell the truth, there might be no use in making Queue fair because Mutex#lock is unfair in Ruby. However, Queue#pop implementation in Ruby 1.9 is almost fair so if there's a good solution... Anyone?&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Anyway, person who is using 1.8 Queue as a thread scheduler should care this change.  My typical usage was as follows.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;# &lt;a href="http://gist.github.com/430066"&gt;http://gist.github.com/430066&lt;/a&gt;&lt;br /&gt;&lt;pre&gt;require 'thread'&lt;br /&gt;&lt;br /&gt;q = Queue.new&lt;br /&gt;t1 = Thread.new {&lt;br /&gt; p [:t1, q.pop]&lt;br /&gt; q.push(:t1)&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;q.push(:main)&lt;br /&gt;p [:main, q.pop]&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;EDITED ADD (8/1): You should wait for the created thread sleeping like the first script on this page.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;By the way, Queue#pop in JRuby (both 1.8 and 1.9 modes) is unfair as well but slightly different from Ruby 1.9; only the main thread break in the scheduler. It's written by @&lt;a href="http://twitter.com/mentalguy"&gt;mentalguy&lt;/a&gt; who is the author or fastthread for Ruby 1.8.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8988607852659582768-142869505361977679?l=soap4r.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://soap4r.blogspot.com/feeds/142869505361977679/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8988607852659582768&amp;postID=142869505361977679' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8988607852659582768/posts/default/142869505361977679'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8988607852659582768/posts/default/142869505361977679'/><link rel='alternate' type='text/html' href='http://soap4r.blogspot.com/2010/07/queuepop-is-unfair-in-ruby-19.html' title='Queue#pop is unfair in Ruby 1.9'/><author><name>NaHi</name><uri>http://www.blogger.com/profile/15802206116733407994</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8988607852659582768.post-2865123665247366603</id><published>2010-04-30T13:18:00.006+09:00</published><updated>2010-07-30T20:30:24.984+09:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jruby'/><category scheme='http://www.blogger.com/atom/ns#' term='openssl'/><title type='text'>JRuby-OpenSSL 0.7 released</title><content type='html'>JRuby-OpenSSL 0.7 released! &lt;a href="http://www.jruby.org/2010/04/27/jruby-openssl-07.html"&gt;http://www.jruby.org/2010/04/27/jruby-openssl-07.html&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;div&gt;All changes which should be noted are in the above release note.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And more: It passes all testcases for ruby-ossl for CRuby 1.8.7 except few classes which are not yet implemented like Cipher::EC.  And I confirmed it passes all testcases of Net::SSH, httpclient, WEBrick, OAuth and rubygems except known issues which are 'wontfix'. (For example, JRuby-OpenSSL does not support 32bit DSA key which is not allowed in BouncyCastle.  Key lengths must be 512-1024 and multiple of 64.)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This release supports JRuby 1.4.0+ but 1.5 is better tested.  Please run your testcases against JRuby + JRuby-OpenSSL/0.7 and file a ticket at &lt;a href="http://bugs.jruby.org/"&gt;http://bugs.jruby.org&lt;/a&gt; when you find a problem.  I think we can fix it at the next release.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It's the first release after I started contributing JRuby-OpenSSL.  Thanks to @&lt;a href="http://twitter.com/nicksieger"&gt;nicksieger&lt;/a&gt; for coordinating my commits and bad English to the release.  It must be an annoying work.  Also thanks to @&lt;a href="http://twitter.com/olabini"&gt;olabini&lt;/a&gt; for creating this &gt;30kloc sources for JRuby world. I bet no one can really understand what you did, except a person who understands Ruby internal and OpenSSL Toolkit internal. Great work, indeed.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8988607852659582768-2865123665247366603?l=soap4r.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://soap4r.blogspot.com/feeds/2865123665247366603/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8988607852659582768&amp;postID=2865123665247366603' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8988607852659582768/posts/default/2865123665247366603'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8988607852659582768/posts/default/2865123665247366603'/><link rel='alternate' type='text/html' href='http://soap4r.blogspot.com/2010/04/jruby-openssl-07-released.html' title='JRuby-OpenSSL 0.7 released'/><author><name>NaHi</name><uri>http://www.blogger.com/profile/15802206116733407994</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8988607852659582768.post-4044331635786311826</id><published>2008-12-17T19:29:00.003+09:00</published><updated>2010-07-30T20:29:48.043+09:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='httpclient'/><title type='text'></title><content type='html'>I did a little benchmark testing on some http client implementations on Ruby.  I'm the author of httpclient (http-access2), one of a http client implementation for Ruby.&lt;br /&gt;&lt;br /&gt;Environment:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;  HTTP Server:&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Apache/2.2.9 (Ubuntu) mpm-worker&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Ubuntu 8.10 32bit&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;HTTP Client:&lt;br /&gt; Ruby: ruby 1.8.7 (2008-12-04 revision 20478) [i686-linux]&lt;br /&gt; vendor:&lt;br /&gt;   eventmachine/0.12.2(*)&lt;br /&gt;   rfuzz/0.9&lt;br /&gt;   net/http (svn ruby_1_8)&lt;br /&gt;   httpclient/2.1.3-RC&lt;br /&gt;   open-uri (svn ruby_1_8) (net/http wrapper)&lt;br /&gt;   httparty/0.2.2 (net/http wrapper)&lt;br /&gt; (*) EM::Protocols::HttpClient2 is not listed below because it does&lt;br /&gt;not work when requests &gt; 20 on my env.&lt;br /&gt;&lt;br /&gt;HTTP Server and HTTP clients runs on the same host.&lt;br /&gt;&lt;br /&gt;Benchmark suite:&lt;br /&gt;http://dev.ctor.org/http-access2/browser/trunk/bench/bm.rb&lt;br /&gt; proxy = nil&lt;br /&gt; url = http://127.0.0.1/&lt;br /&gt; threads = 2&lt;br /&gt; requests = 250&lt;br /&gt;&lt;br /&gt;Result:&lt;br /&gt;HTTP Server KeeyAlive: Off&lt;br /&gt;                         user     system      total        real&lt;br /&gt; curb                0.050000   0.420000   0.470000 (  0.807049)&lt;br /&gt; RFuzz::HttpClient   0.090000   0.430000   0.520000 (  0.803075)&lt;br /&gt; Net::HTTP           0.280000   0.520000   0.800000 (  1.147281)&lt;br /&gt; HTTPClient          0.140000   0.800000   0.940000 (  1.299928)&lt;br /&gt; open-uri            0.420000   0.880000   1.300000 (  1.675272)&lt;br /&gt; HTTParty            0.490000   0.620000   1.110000 (  1.483024)&lt;br /&gt;&lt;br /&gt;HTTP Server KeeyAlive: On&lt;br /&gt;                         user     system      total        real&lt;br /&gt; curb                0.100000   0.460000   0.560000 ( 51.170485)&lt;br /&gt; RFuzz::HttpClient   0.030000   0.580000   0.610000 (  1.001198)&lt;br /&gt; Net::HTTP           0.150000   0.490000   0.640000 (  0.842344)&lt;br /&gt; HTTPClient          0.140000   0.460000   0.600000 (  0.801035)&lt;br /&gt; open-uri            0.740000   0.740000   1.480000 (  1.870712)&lt;br /&gt; HTTParty            0.710000   0.880000   1.590000 (  2.555711)&lt;br /&gt;&lt;br /&gt;Considerations:&lt;br /&gt;1. EM::Protocols::HttpClient2 does not work on my env.  Is the&lt;br /&gt;client code right?&lt;br /&gt;2. curb needs too much 'real' time when connecting to KeepAlive: On&lt;br /&gt;site.  Is this expected?&lt;br /&gt;3. rfuzz and curb are faster than net/http and httpclient when&lt;br /&gt;connecting to KeepAlive: Off site.&lt;br /&gt;4. net/http and httpclient run almost as fast as rfuzz when&lt;br /&gt;connecting to KeepAlive: On site.  Bear in mind that you need to call&lt;br /&gt;Net::HTTP#start and #finish by yourself for keep-alive handling.  Just&lt;br /&gt;calling Net::HTTP#get takes 2 times longer than others.  Bothersome?&lt;br /&gt;Use others.&lt;br /&gt;&lt;br /&gt;At the last, does somebody know how I can read&lt;br /&gt;http://apocryph.org/more_indepth_analysis_ruby_http_client_performance&lt;br /&gt;?  I get 'Error establishing a database connection'.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8988607852659582768-4044331635786311826?l=soap4r.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://soap4r.blogspot.com/feeds/4044331635786311826/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8988607852659582768&amp;postID=4044331635786311826' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8988607852659582768/posts/default/4044331635786311826'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8988607852659582768/posts/default/4044331635786311826'/><link rel='alternate' type='text/html' href='http://soap4r.blogspot.com/2008/12/i-did-little-benchmark-testing-on-some.html' title=''/><author><name>NaHi</name><uri>http://www.blogger.com/profile/15802206116733407994</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8988607852659582768.post-8593283547464244613</id><published>2007-10-25T15:16:00.003+09:00</published><updated>2008-03-20T07:58:07.913+09:00</updated><title type='text'>vim + rtags</title><content type='html'>I use vim for Ruby development.  I was an emacsen in school days (10-15 years ago) but it requires a keyboard which has a Ctrl at the left down corner for me.  I finished to use emacs when I started to use notebook computers.&lt;br /&gt;&lt;br /&gt;For development on vim, tags file is a must.  To create tags file for vim, I use &lt;a href="http://rubyforge.org/projects/rtags/"&gt;rtags&lt;/a&gt;.  rtags uses Ruby lexer in irb.  It &lt;s&gt;corrects&lt;/s&gt; collects enough tags for me though it's rather slow.  Exuberant ctags runs much faster but it slips some important tags in Ruby.&lt;br /&gt;By the way, the author of irb (keiju) developed rtags.rb which had been published with irb before irb was bundled with Ruby.&lt;br /&gt;&lt;br /&gt;Unfortunately, rtags, ctags and rtags.rb all do not support 'class Foo::Bar' notation now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8988607852659582768-8593283547464244613?l=soap4r.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://soap4r.blogspot.com/feeds/8593283547464244613/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8988607852659582768&amp;postID=8593283547464244613' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8988607852659582768/posts/default/8593283547464244613'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8988607852659582768/posts/default/8593283547464244613'/><link rel='alternate' type='text/html' href='http://soap4r.blogspot.com/2007/10/vim-rtags.html' title='vim + rtags'/><author><name>NaHi</name><uri>http://www.blogger.com/profile/15802206116733407994</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8988607852659582768.post-2836079800055479670</id><published>2007-10-24T23:09:00.000+09:00</published><updated>2007-10-24T23:36:35.406+09:00</updated><title type='text'>Time.now is slow?</title><content type='html'>&lt;span style="font-family:verdana;"&gt;It's said on Rails Tokyo meeting on 10/21.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;He created a Rails application and profiled it with ruby-prof. He found that Time.now in a deep loop exhausts much time so he wrote an extension that did gettimeofday() to get Epoch elapsed time in float. It solves performance problem of his Rail application.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;time_init in time.c just executes gettimeofday() and construct an object.  What else do we need?!&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8988607852659582768-2836079800055479670?l=soap4r.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://soap4r.blogspot.com/feeds/2836079800055479670/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8988607852659582768&amp;postID=2836079800055479670' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8988607852659582768/posts/default/2836079800055479670'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8988607852659582768/posts/default/2836079800055479670'/><link rel='alternate' type='text/html' href='http://soap4r.blogspot.com/2007/10/timenow-is-slow.html' title='Time.now is slow?'/><author><name>NaHi</name><uri>http://www.blogger.com/profile/15802206116733407994</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
