Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Correct approach to multi-threading

I have recently pondered on the general approach to multi-threaded code that would be most efficient. As with concurrent collections atomic mechanisms such as Compare-And-Swap are used to provide efficient implementation of collections such as queues. I was wondering whether there are any new approaches to writing multi-threaded code, for instance in java, rather than using pure Thread instances? Are thread pools used more often perhaps?

like image 422
Bober02 Avatar asked Nov 29 '25 04:11

Bober02


1 Answers

There are few new approaches emerging:

  • message passing and actor-model, see akka (well, the idea comes from erlang...)

  • gpu - massive multithreading with thousands of simple micro-threads

  • transactional memory (see: clojure)

like image 110
Tomasz Nurkiewicz Avatar answered Nov 30 '25 16:11

Tomasz Nurkiewicz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!