Re: [webkit-dev] parallel controls in JavaScriptCore engine
> So my question here is, is this really possible to stop execution at one > place and execute some thing else and resume back to previous execution point > with JavaScript engine of Webkit. Yes. > I have tried this using two threads by blocking the wait using mutex and > calling success/failure callback using another thread but it app crashing. You'll need to provide more information in order to get help. Did you debug the crash? What did you find? Though JavaScriptCore is threadsafe, WebKit is not. Geoff ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
Re: [webkit-dev] parallel controls in JavaScriptCore engine
Hi, why don't you simply use a workaround? function success() { alert("Success"); continueTask(true); } function failure() { alert("Failure"); continueTask(false); } function continueTask(success) { x= 10+1; } Zoltan > Hello, > > As part of my project, we need to implement custom JS objects using > JavaScriptCore API. > I am seeking help in implementing in implementing one of the requirement > and > its possibility of accomplishing it in Webkit/JavaScriptcore. > So, the requirement is, We need to add custom JS object , lets say > "MyObject" and this object has one method wait() which should block the > control until its previously requested operation completes. > > in Detail, > * > > function success() > { >alert("Success"); > } > > function failure() > { >alert("Failure"); > } > > MyObject.postMessage(success,failure,"hello, How r u?"); > MyObject.wait(); > x= 10+1; > * > > Here, MyObject.wait() should resume only after either of its success or > failure callback is executed. The statement "x=10+1" would be executed > only > after either success or failure callback invoked. > > So my question here is, is this really possible to stop execution at one > place and execute some thing else and resume back to previous execution > point with JavaScript engine of Webkit. > > I have tried this using two threads by blocking the wait using mutex and > calling success/failure callback using another thread but it app crashing. > > Can you please suggest me what are the possible ways to achieve the above > requirement. > > > Thanks > Srinu > ___ > webkit-dev mailing list > webkit-dev@lists.webkit.org > http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev > ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
Re: [webkit-dev] parallel controls in JavaScriptCore engine
I'm not sure if there's a short-cut, but you essentially want a JavaScript engine that uses continuation-passing style: http://en.wikipedia.org/wiki/Continuation-passing_style Certainly doable but likely difficult. Adam On Mon, Jun 28, 2010 at 1:30 AM, Srinivasa Rao Edara wrote: > Hello, > > As part of my project, we need to implement custom JS objects using > JavaScriptCore API. > I am seeking help in implementing in implementing one of the requirement and > its possibility of accomplishing it in Webkit/JavaScriptcore. > So, the requirement is, We need to add custom JS object , lets say > "MyObject" and this object has one method wait() which should block the > control until its previously requested operation completes. > > in Detail, > > > function success() > { > alert("Success"); > } > > function failure() > { > alert("Failure"); > } > > MyObject.postMessage(success,failure,"hello, How r u?"); > MyObject.wait(); > x= 10+1; > > > Here, MyObject.wait() should resume only after either of its success or > failure callback is executed. The statement "x=10+1" would be executed only > after either success or failure callback invoked. > > So my question here is, is this really possible to stop execution at one > place and execute some thing else and resume back to previous execution > point with JavaScript engine of Webkit. > > I have tried this using two threads by blocking the wait using mutex and > calling success/failure callback using another thread but it app crashing. > > Can you please suggest me what are the possible ways to achieve the above > requirement. > > > Thanks > Srinu > > ___ > webkit-dev mailing list > webkit-dev@lists.webkit.org > http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev > > ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
[webkit-dev] parallel controls in JavaScriptCore engine
Hello, As part of my project, we need to implement custom JS objects using JavaScriptCore API. I am seeking help in implementing in implementing one of the requirement and its possibility of accomplishing it in Webkit/JavaScriptcore. So, the requirement is, We need to add custom JS object , lets say "MyObject" and this object has one method wait() which should block the control until its previously requested operation completes. in Detail, * function success() { alert("Success"); } function failure() { alert("Failure"); } MyObject.postMessage(success,failure,"hello, How r u?"); MyObject.wait(); x= 10+1; * Here, MyObject.wait() should resume only after either of its success or failure callback is executed. The statement "x=10+1" would be executed only after either success or failure callback invoked. So my question here is, is this really possible to stop execution at one place and execute some thing else and resume back to previous execution point with JavaScript engine of Webkit. I have tried this using two threads by blocking the wait using mutex and calling success/failure callback using another thread but it app crashing. Can you please suggest me what are the possible ways to achieve the above requirement. Thanks Srinu ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev