You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Trent Ahrens <ta...@brunnerworks.com> on 2012/03/14 17:31:53 UTC

[Vysper] Routing/session synchronization question

I have been thinking about different race conditions that can occur in Vysper and this particular one I'm stumped.

>From what I can tell each session context runs on its own thread, what happens if:
Thread 4 Session-1 recieves message and is processed and passed into router
Thread 4 router fetches destination Session-2 from resource registry
Thread 4 paused by kernal
Thread 5 Session-2 has end session called, closing down IO and being removed from resource registry
Thread 4 resumed by kernal
Thread 4 router tries to write stanza to Session-2

I don't see how the session throws an error in this instance, I also can't see how there is synchronization support in the processor/router pipeline guarding against this condition.

Am I missing something?

Trent Ahrens
Emerging Media Developer

Brunner
11 Stanwix Street
Pittsburgh PA 15222
www.brunnerdigital.com<http://www.brunnerdigital.com/>
www.brunnerworks.com<http://www.brunnerworks.com/>