User loginNavigation |
Avoiding Actor Deadlocks--JActorThe problem is that actors do not always process messages in the order received, but may limit processing to selected messages based on their current state. This technique is often used when waiting for a response from another actor. Clearly this can lead to something like deadlock where several actors freeze up, even though no locks are used. JActor takes a different tack. Messages are processed in the order received, but messages are mostly 2-way and are first class objects with each message only being used once. This means that while processing a message, it can be a place to save intermediate state. So if processing involves sending messages to other actors, there is no need to update the actor's state until message processing is complete. Another difference is that when a message is returned as a response, it is dispatched differently from other messages. When a message is first sent, it serves as a request and is assigned a callback that will be used when the message is returned with a response value. But note that actors process messages one at a time as a means of thread safety, and this applies as well to the invocation of the callback when processing a response. This is covered in a lot more detail in the JActor project README. By laforge49 at 2014-03-25 02:56 | LtU Forum | previous forum topic | next forum topic | other blogs | 8220 reads
|
Browse archives
Active forum topics |
Recent comments
22 weeks 6 days ago
22 weeks 6 days ago
22 weeks 6 days ago
45 weeks 1 day ago
49 weeks 3 days ago
51 weeks 5 hours ago
51 weeks 5 hours ago
1 year 1 week ago
1 year 6 weeks ago
1 year 6 weeks ago