19 Jul 2012, 16:42
Generic-user-small

José A. S. Alegria (4 posts)

Hi! It seems that TupleSpace bin’s are Last In First Out (LIFO). Is there a reason why they are not instead First In First Out (FIFO)?

  def find(&blk)
    @bin.reverse_each do |x|
      return x if yield(x)
    end
    nil
  end

Regards,

José Alegria

20 Jul 2012, 06:05
Generic-user-small

Makoto Inoue (9 posts)

Hi, José.

I asked Seki san.

Apparently it’s result of the performance tuning. When you are dealing with lots of tuples (eg: 100,000), then deleting from the bottom of Array makes operation faster.

If you want to guarantee the order, then you can either pass the index number (as explained in page 130), or could use Drip.

Thanks.

Makoto

26 Jul 2012, 22:22
Generic-user-small

José A. S. Alegria (4 posts)

Thanks!

  You must be logged in to comment