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

Re: [Public WebGL] Addition to WebGLContextLostEvent wrt extensions



On Apr 8, 2010, at 9:50 AM, Gregg Tavares wrote:

> Maybe this well help describe my concern.
> 
> Imagine you had a i/o device API with a "device lost" and "device recovered" and you wrote code like this.
> 
> f = device.openfile(...);
> somethingUnrelatedToDevice.addEventHandler("moreDataAvailableEvent", writeMoreData);
> 
> function writeMoreData(data) {
>   f.write(data);
>   if (data.finished) {
>     f.closefile();
>   }
> }
> 
> Now imagine while writing the data you get a "device lost" and a "device recovered". You've now written a bad file because you're missing some portion of the middle of the data.
> 
> That's the model WebGLContextRestored seems to be providing. You get effectively random failure and random success instead of something more predictable  With the Resetable/Reset model you get random failure but never random success. You recover on your own terms, not some random terms.


I'm not sure what you mean. No matter what model you use, if you're not checking for errors while using an object, you will get incorrect results. In your example, if the machine were shutdown while writing a file, one of those f.write calls would return an error. You'd then know the written file is corrupt. When the device was restored, you'd destroy that file, open a new one and ask the provider for the data again. I don't see any way around this, regardless of the semantics of the API.

Am I misunderstanding the problem?

-----
~Chris
cmarrin@apple.com




-----------------------------------------------------------
You are currently subscribe to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email: