Re: Web workers: synchronously handling events

2010-12-29 Thread Jonas Sicking
On Sun, Dec 26, 2010 at 4:29 PM, Glenn Maynard gl...@zewt.org wrote: Havn't been able to find this in the spec: is there a way to allow processing messages synchronously during a number-crunching worker thread? A typical use case is a CPU-intensive task that needs to be aborted due to user

Re: Web workers: synchronously handling events

2010-12-29 Thread Glenn Maynard
On Wed, Dec 29, 2010 at 4:56 AM, Jonas Sicking jo...@sicking.cc wrote: I definitely agree that workers need more features to take advantage of the fact that they are running on their own event loop. One of which is the one you are asking for. We could add something like: boolean

Re: Web workers: synchronously handling events

2010-12-29 Thread Jonas Sicking
On Wed, Dec 29, 2010 at 10:33 AM, Glenn Maynard gl...@zewt.org wrote: On Wed, Dec 29, 2010 at 4:56 AM, Jonas Sicking jo...@sicking.cc wrote: I definitely agree that workers need more features to take advantage of the fact that they are running on their own event loop. One of which is the one

Re: Web workers: synchronously handling events

2010-12-28 Thread Tab Atkins Jr.
On Sun, Dec 26, 2010 at 4:29 PM, Glenn Maynard gl...@zewt.org wrote: Havn't been able to find this in the spec: is there a way to allow processing messages synchronously during a number-crunching worker thread? Yes, by pausing every once in a while with setTimeout and letting the event loop

Re: Web workers: synchronously handling events

2010-12-28 Thread Glenn Maynard
On Tue, Dec 28, 2010 at 3:06 PM, Tab Atkins Jr. jackalm...@gmail.com wrote: Yes, by pausing every once in a while with setTimeout and letting the event loop spin. Doing anything else would break javascript's appearance of single-threadedness. I'm not suggesting that events should run on

Web workers: synchronously handling events

2010-12-26 Thread Glenn Maynard
Havn't been able to find this in the spec: is there a way to allow processing messages synchronously during a number-crunching worker thread? A typical use case is a CPU-intensive task that needs to be aborted due to user action. For example, it might take 250ms to run a search on a local