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

I guess an obvious difference is that Go has these stuff built into runtime and syntax, which makes those light-weight threads / tasks a first class thing.

Furthermore, is there a way in "Java SingleThreadExecutor" and its related components that allow automatic scheduling tasks on different threads? For example, you are on a quad-core and you want to have 4 threads running together, with millions of tasks mapped to 4 threads and dynamically balanced.



I believe that's what the ForkJoinPool is for.

http://docs.oracle.com/javase/7/docs/api/java/util/concurren...


Sure, you can replace SingleThreadExecutor by Executors.newFixedThreadPool(4)




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

Search: