javascript concurrency

01 Feb 2018 | | javascript

“Captain’s log stardate… unknown. During an ion storm the landing party has beamed back to the Enterprise and found it and the personnel aboard changed. The ship is subtly altered physically. Behavior and discipline has become brutal, savage.” Startrek Mirror Mirror episode parallel universe.

Javascript does not run things in parallel

Concurrency

“Concurrency can be defined as multiple things happening in the same time frame..but not really at the same time.

That is what the javascript event loop really gives us. That advantage is that we don’t have to manage things running at the exact same time which is way more complicated to do.

So

In javascript what we are focused on is breaking down the tasks and scheduling them in the best order within context of coordinating concurrency.

Javascript is single-threaded no matter what. But we can simulate multi-threading.

To coordinate concurrency we can use callbacks…and now promises via ES6..

comments powered by Disqus(comments off)

Older · View Archive (32)

ES6

references and credits(Nicholas C. Zakas): Understanding ECMAScript 6

You’re a blockhead charlie brown!

Newer

Node the right way

I was in a small local mexican restaurant(with a little bar) once called Via Sombrero…they claimed to have the “best margaritas in town”…well..maybe the strongest…anyway I was sitting next to a fellow and the conversation drifted to New Orleans..where he was from..so I said “New Orleans…I always wanted to go”…he put down his best margarita and said to me..”it’s Nawlons…if you’re gonna say it..say it right…well…I have looked at a LOT of node books…and this one written by Jim R. Wilson who works at Google..looks to me like a good one..cause…if you are gonna do node…do it right..

My dudley doo-right node notes