Il Sat, 19 Apr 2014 03:43:41 -0700, Floby ha scritto:

> Your problem is not asynchrony vs synchrony. Please forget these words.
> Nothing ever happens synchronously on a computer. You've been lied to
> all your life, sorry.

I think you are confusing async and sync.

Nowadays, both sync (serial) and async (parallel) operations can happen 
on a PC, as every single core in the CPU can work in parallel with the 
others.
Normally node runs on a single process (and core) so it's not 
multithreaded (unless you use some specific modules), and simulates 
preemptive multitasking like the OS scheduler do. Async operations in 
node are necessary to avoid blocking the "core" (the whole app) while 
waiting, for example, for a file to be read or a socket to receive data.

> Some operations
> need to wait for something else to finish. These are async operations.

No. those are sync operations.

> In some environments, async operations are made to look synchronous
> using things such as threads, processes and fibers.

And those (parallel) are async.

> My third advice is to use async.waterfall from the async library. And
> this is my favourite way of doing things.

async.waterfall is simply a method to transform async operations in sync 
ones (executing them one after another).

Bye.


-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to