scala - Using locks on Akka Actors -


i have actor goes (assume receive method overridden somewhere else):

class myclass extends actor {        def method1() = { ... }    def method2() = { ... }    def method3() = {          this.synchronized {       ....       ....     }   } } 

what happens if have final field defined in actor as:

private val locktype = new anyref 

i can use lock synchronize method3? difference? understanding using reference lock on method make reference unavailable until lock released.

in above case, use lock can function independently of reference , lock when action on method3 made, while reference still available other threads?

there's no need synchronization inside of actor. actor ever process single message @ time.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -