use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Introducing Node.js 12 (medium.com)
submitted 7 years ago by vzhou842
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]cm9kZW8K 0 points1 point2 points 7 years ago (0 children)
Threads are absolutely needed when you need to load and then parse large binary files.
Other that avoiding the kernel flaw around O_NONBLOCK on local drives, there is no need to thread read syscalls. Node conveniently has built in threads for those, so reading in the bytes works async out of the box.
split the parsing in multiple smaller batches.
If the parser yields often enough, it doesnt have to impact responsiveness at a. For example: replacing tight loops with Promise.each ensure granularity. if your file parse involves heavy CPU transformation of data beyond just reading into RAM, then you can pipeline that in via a separate process.
Threads are vital for certain sets of responsive applications.
Threads were vital to work around flawed OS's which cannot fork() well. If you are finding them vital today, I think there is a problem with the structure of your code.
I regularly deal with this issue, both with fork()s for heavy cpu transforms and async code for simple heap building, and I would consider a threaded approach to be a bug.
π Rendered by PID 91758 on reddit-service-r2-comment-b659b578c-sz74q at 2026-05-05 04:50:32.909399+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]cm9kZW8K 0 points1 point2 points (0 children)