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

You typically don't, as knowing which physical thread you're running in is (thankfully) becoming a relic of the past.


UI programming is one domain where it's important to know this.


Even there, you only care that you aren't running on a particular thread, just NOT on one particular thread. You still pass it to an executor that has it's own thread pool and shouldn't be terribly concerned with the particular thread.


Yes, that's fair. My domain is backend.

(I use and love fish shell for many years now; thank you.)


Same with graphics/game programming, particularly as some APIs (looking at you, OpenGL) are entirely built on thread-local state.


Java parallel streams use a global thread pool by default. The problem with this is that if you mix IO bound code and CPU bound code in the same thread pool the IO bound code will block the CPU bound code. If you don't explicitly choose the thread pool your code runs on then you will suffer from impossible to debug performance problems.




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

Search: