Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Single threaded yes?
Mon, Jul 11 2016 4:58 AMPermanent Link

Matthew Jones

Am I right in thinking that Javascript applications are single
threaded? So I don't have to worry about adding something to a list
while at the same time processing the list? That is, if I get a cound
of the items and do a for loop on them, nothing can jump in
unexpectedly and add another item or remove one or something. (Perhaps
if I async something then that might cause issues, but I'm assuming
simple code.)

If it is possible, what is the "critical section" equivalent?

--

Matthew Jones
Mon, Jul 11 2016 8:26 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

Yep, single-threaded, all the way.

Tim Young
Elevate Software
www.elevatesoft.com
Wed, Jul 13 2016 9:07 PMPermanent Link

erickengelke

Tim Young [Elevate Software] wrote:

>Yep, single-threaded, all the way.

If you are interested, it's possible to do multithreaded with EWB using Web Workers.  The way it works you do not have to worry about concurrency because there is no sharing of objects, just message passing.  

But unless you've gone to the trouble of including Web Workers, there is no worry about concurrency.

Erick
Image