Re: Question about the sequential flag on create.

2009-07-14 Thread Patrick Hunt
Nodes are maintained un-ordered on the server. A node can store any 
subnodes, not exclusively sequential nodes. If we added an ordering 
guarantee then then server would have to store the children sorted for 
every parent node. This is a problem for a few reasons; 1) in many cases 
you don't care about order, so all users would pay for ordering even if 
they didn't want/use it, 2) the ordering would be done by the central 
server, which would result in lower performance for everyone, not just 
the client(s)/recipe(s) that needed ordering, 3) there is no guarantee 
that the ordering you need (path) is the same order needed by all recipes.


Patrick

Erik Holstad wrote:

Hi Mahadev!
Yeah kinda, what I was looking for was some kind of explanation of why this
is, since they are stored in a list
and it seems like new children would just be appended to the list. So I
guess my question should have been
more along the lines of something like:
What is it internally that causes new nodes not the be inserted in order?
What causes the lag from getting the
sequence number till putting it into the list?
Or is this not at all how this works?

Regards Erik



Re: Question about the sequential flag on create.

2009-07-14 Thread Erik Holstad
Hey Patrik!
Thanks for the reply.
I understand all the reasons that you posted above and totally agree that
nodes should not be sorted since you then have to pay that overhead for
every node, even though you might not need or want it.
I just thought that it might be possible to create a sequential node
atomically, but I guess that is not how it works?

Regards Erik


Re: Question about the sequential flag on create.

2009-07-14 Thread Benjamin Reed
the create is atomic. we just use a data structure that does not store 
the list of children in order.


ben

Erik Holstad wrote:

Hey Patrik!
Thanks for the reply.
I understand all the reasons that you posted above and totally agree that
nodes should not be sorted since you then have to pay that overhead for
every node, even though you might not need or want it.
I just thought that it might be possible to create a sequential node
atomically, but I guess that is not how it works?

Regards Erik
  




Re: Question about the sequential flag on create.

2009-07-14 Thread Erik Holstad
Thanks Patrick!


Question about the sequential flag on create.

2009-07-13 Thread Erik Holstad
Hey!
I have been playing around with the queue and barrier example found on the
home page and have some questions about the code.
First of all I had trouble getting the queue example to work since the code
turns the sequence number into an int and then try to get information
from it, missing out the padding, which caused some confusion at first. So I
changed it to compare the strings themselves so you didn't have to
add the padding back on.

So the fact that you have to sort the children every time you get them is a
little bit confusing to me, does anyone have simple answer to why that is?

Regards Erik


Re: Question about the sequential flag on create.

2009-07-13 Thread Erik Holstad
Hi Mahadev!
Thanks for the quick reply. Yeah, I saw that in the source, but was just
curious why that is, since it is a part of an internal
counter structure, right?

Regards Erik