[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [www-vrml] Re: [Vrspace-dev] Cortona createVrmlFromURL bug test code





Second, it's a bad (automatic?) translation from Russian. That's what I've wrote: "I can not see how it can break program logic, taking into account that createVrmlFromUrl() completion time and callbacks calling order are non-deterministic."

The fact that createVrmlFromUrl completion time and callbacks are non-deterministic
is precisely the reason why you want a callback for each call. How else are you going to
know if, how, and when the operation completed?



The problem arises when several calls to createVrmlFromUrl() where
completed in the same frame (see. ISO/IEC 14772-1, 3.33 frame).
Cortona then sends multiple addChildren events to the receiving node.
Changes in the children field can fire one or more children_changed
events, but only one is sent out (see the last paragraph of `4.10.3
Execution model' and `4.12.9.3 Sending eventOuts').

> > Hah, hah, hah,  well you see, since the standard is vague we decided to
As you can see, the standard is absolutely clear. You just have to
become accustomed to read it.

I am not so familiar with the standard, so I have read through the sections that you
have highlighted. I'm not quite sure I see how some of them apply, but I did see this statement:


4.10.3:
Nodes that contain eventOuts or exposedFields shall produce at most one event per timestamp


This is what you are arguing? If you complete two different createVrmlFromURL calls and the two
associated MFNode events are received in the same timestamp/frame, then only one children_changed
event is produced as a result of this? Where does it say in the standard that you cannot coordinate your
completions of the createVrmlFromUrl calls so that you send IN only one event per timestamp? i.e.
onCreateVrmlFromUrl completes:
if ( already sent a createVrmlFromUrl node to target event in this frame ) {
wait frame
} else {
send nodes
}
Contact apparently does this, I think its a much better handling of the spec...



> > choose a retarded method of implementing it, so therefore, its not a bug,
> > its a feature!!!   No competent software designer would consider random
> > callbacks to an asynchronous api call acceptable.   Come on now...

Well, explain me, as one competent software designer to other
competent software designer what for do you use callbacks if their
count is so important?

Again, its an asynchronous call in the first place, so you want to know when it
completes. But here are some examples of why you would want to know:
a) Oops, it didn't work, maybe I should try to get the object again
b) Uh oh, I have tried n times and still no luck, I'll give up now.
c) Great, I got the object, now I can commence with initializing it. i.e. this
is the vrml code associated to a shared object. Now that it has been created, I want
to
i) Start listening to its events out so I can propagate them across the net.
ii) Send in its initial events and tell it to start functioning.


And at last a simple example of events handling in different browsers.
Load the file in a browser, open a console, and click a sphere. You've
got one message in Cortona and Cosmo. Guess, how much do you get in
Contact?

#VRML V2.0 utf8

DEF G Group {
 children [
  Shape {
   geometry Sphere      {
   }
  }
 ]
}

DEF TS TouchSensor {
}

DEF S Script {
 eventIn SFTime touchTime1
 eventIn SFTime touchTime2

 eventOut MFNode addChildren1
 eventOut MFNode addChildren2

 eventIn MFNode children_changed

url "javascript:
function touchTime1()
{
addChildren1 = new MFNode(new SFNode('Shape { geometry Cone {}}'));
}
function touchTime2()
{
addChildren2 = new MFNode(new SFNode('Shape { geometry Box { size 1 5 1}}'));
}
function children_changed(v, t)
{
trace('G.children_changed: ' + v.length);
trace('time: ' + t);
}
"
}


ROUTE TS.touchTime TO S.touchTime1
ROUTE TS.touchTime TO S.touchTime2

ROUTE S.addChildren1 TO G.addChildren
ROUTE S.addChildren2 TO G.addChildren

ROUTE G.children_changed TO S.children_changed

#END OF VRML

Dmitry Egorenkov
Cortona Team Leader
ParallelGraphics


------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Vrspace-dev mailing list Vrspace-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vrspace-dev

------------------------------------------------------------------------- for list subscription/unsubscription, go to http://www.web3d.org/cgi-bin/public_list_signup/lwgate/listsavail.html