[前][次][番号順一覧][スレッド一覧]

ruby-changes:27871

From: drbrain <ko1@a...>
Date: Mon, 25 Mar 2013 07:09:44 +0900 (JST)
Subject: [ruby-changes:27871] drbrain:r39923 (trunk): * lib/rinda/tuplespace.rb: Only return tuple entry once on move,

drbrain	2013-03-25 07:09:35 +0900 (Mon, 25 Mar 2013)

  New Revision: 39923

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=39923

  Log:
    * lib/rinda/tuplespace.rb:  Only return tuple entry once on move,
      either through port or regular return, not both.  This results in a
      120% speedup when combined with #8125.  Patch by Joel VanderWerf.
      [ruby-trunk - Feature #8119]

  Modified files:
    trunk/ChangeLog
    trunk/lib/rinda/tuplespace.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 39922)
+++ ChangeLog	(revision 39923)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Mon Mar 25 07:09:20 2013  Eric Hodel  <drbrain@s...>
+
+	* lib/rinda/tuplespace.rb:  Only return tuple entry once on move,
+	  either through port or regular return, not both.  This results in a
+	  120% speedup when combined with #8125.  Patch by Joel VanderWerf.
+	  [ruby-trunk - Feature #8119]
+
 Mon Mar 25 06:59:01 2013  Eric Hodel  <drbrain@s...>
 
 	* test/rinda/test_rinda.rb:  Skip IPv6 tests if no IPv6 addresses
Index: lib/rinda/tuplespace.rb
===================================================================
--- lib/rinda/tuplespace.rb	(revision 39922)
+++ lib/rinda/tuplespace.rb	(revision 39923)
@@ -491,7 +491,7 @@ module Rinda https://github.com/ruby/ruby/blob/trunk/lib/rinda/tuplespace.rb#L491
           port.push(entry.value) if port
           @bag.delete(entry)
           notify_event('take', entry.value)
-          return entry.value
+          return port ? nil : entry.value
         end
         raise RequestExpiredError if template.expired?
 
@@ -506,7 +506,7 @@ module Rinda https://github.com/ruby/ruby/blob/trunk/lib/rinda/tuplespace.rb#L506
               port.push(entry.value) if port
               @bag.delete(entry)
               notify_event('take', entry.value)
-              return entry.value
+              return port ? nil : entry.value
             end
             template.wait
           end

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]