multithreading - Compile Java to behave like GO code -


would possible write java compiler or virtual machine let compile legacy java application use thread , blocking system call same way go program compiled.

thus new thread().run(); create light weight thread , blocking system call instead asynchronous operating system call , make light weight thread yield.

if not, main reason impossible!

james henstridge has provided background on java green threads, , efficiency problems introduced exposing native os threads programmer because use expensive.

there have been several university attempts recover situation. 2 such jcsp kent , ctj (albeit defunct) twente. both offer easy design of concurrency in go style (based on hoare's csp). both suffer poor jvm performance of coding in way because jvm threads expensive.

if performance not critical, csp superior way achieve concurrent design because avoids complexities of asynchronous programming. can use jcsp in production code - do.

there reports jcsp team had experimental jni-add-on jvm modify thread semantics more efficient, i've never seen in action.

fortunately go can "have cake , eat it". csp-based happen-before simplicity, plus top performance. yay!

aside: interesting oxford university paper reported on continuation-passing style modification concurrent scala programs allows csp used on jvm. i'm hoping further news on @ cpa2014 conference in oxford august (forgive plug!).


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -