Feature Request

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Feature Request

Robert Parham

Are there any threading proposals? If not, would anyone be interested in creating one?

Webworkers are great, but require separate files that just aren't always convenient to maintain. I've
created this wrapper for webworkers that allows users to create in-line disposable threads, somewhat
similar to threads in Java.


If we could get something similar implemented natively that would be very cool.

Robert "Gordie" Parham
813.616.0819

ad.png



_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Feature Request

guest271314

On Tue, Jun 25, 2019 at 1:51 PM Robert Parham <[hidden email]> wrote:

Are there any threading proposals? If not, would anyone be interested in creating one?

Webworkers are great, but require separate files that just aren't always convenient to maintain. I've
created this wrapper for webworkers that allows users to create in-line disposable threads, somewhat
similar to threads in Java.


If we could get something similar implemented natively that would be very cool.

Robert "Gordie" Parham
813.616.0819

ad.png


_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Feature Request

guest271314
In reply to this post by Robert Parham
Evidently ```TaskWorklet``` is no longer implemented by Chromium https://bugs.chromium.org/p/chromium/issues/detail?id=879306. Though ```TaskQueue```  https://chromium.googlesource.com/chromium/src/+/64f633432afef4a8779b45229eb3b7a060222bb0 is still defined at ```window```.  

```
    (async() => {
      const queue = window.TaskQueue.default("best-effort");
      let result = void 0;
      await queue.postTask(function() { result = "task1" });
      console.log(result);
    })();
```


On Tue, Jun 25, 2019 at 1:51 PM Robert Parham <[hidden email]> wrote:

Are there any threading proposals? If not, would anyone be interested in creating one?

Webworkers are great, but require separate files that just aren't always convenient to maintain. I've
created this wrapper for webworkers that allows users to create in-line disposable threads, somewhat
similar to threads in Java.


If we could get something similar implemented natively that would be very cool.

Robert "Gordie" Parham
813.616.0819

ad.png


_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Feature Request

Isiah Meadows-2
In reply to this post by Robert Parham
I've weakly suggested this in the past (sorry, buried in old list
discussions and IRC), but I haven't come up with something that 1.
doesn't have nearly the overhead of web workers, and 2. doesn't have
nearly the footguns of C's direct thread-based model that's mostly
emulated by practically every remotely major software programming
language not using CSP or actors/processes. The first is difficult to
avoid without avoiding message passing altogether, hence why
`SharedArrayBuffer` appeared in the first place. The second is
difficult to avoid if you want to minimize message passing overhead,
especially without immutable objects (which can usually be sent
without copy between threads of the same parent process).

Given Erlang's parallel programming model has proven itself to stand
the test of time (it's hardly changed since the 80s) and that others
(such as Ruby and some Java circles) are planning to adapt it, I feel
it might be worth waiting for this stage-0 proposal to make it in in
some form or another first, *then* pushing for language-level support
of parallelism: https://github.com/rricard/proposal-const-value-types/

-----

Isiah Meadows
[hidden email]
www.isiahmeadows.com

-----

Isiah Meadows
[hidden email]
www.isiahmeadows.com


On Tue, Jun 25, 2019 at 9:51 AM Robert Parham <[hidden email]> wrote:

>
>
> Are there any threading proposals? If not, would anyone be interested in creating one?
>
> Webworkers are great, but require separate files that just aren't always convenient to maintain. I've
> created this wrapper for webworkers that allows users to create in-line disposable threads, somewhat
> similar to threads in Java.
>
> https://gist.github.com/Pamblam/683d5ae429448adfa6d6e7fb30de39b2
>
> If we could get something similar implemented natively that would be very cool.
>
> Robert "Gordie" Parham
> pamblam.com
> 813.616.0819
>
>
>
>
> _______________________________________________
> es-discuss mailing list
> [hidden email]
> https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss