Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

A future or promise is not a replacement for locks and mutexes. They are intended to abstract async operations for lazy evaluation and intend to fix the problem of "callback hell" that occurs when chaining async operations and response handlers.

Futures and promises make more sense in functional languages because they don't have a shared memory model, which avoids having to share resources between parallel tasks using locks. Google dataflow programming for more insight into how lazy evaluation and referential transparency parallelize work when there's no mutable state.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: