View Single Post
Old 11-18-2012, 12:24 PM   #12
koteko
New Member
 
Join Date: Mar 2012
Posts: 20
koteko is on a distinguished road
Re: Event-based with threads instead of game loop

Ah! That's cool. I do use synchronized and static methods, but in this way you have actually created a passive bottleneck, instead of an ActionExecutor, which uses the fact that the JVM "enqueues" the subsequent calls to a synchronized function. It's still as similar to the idea of a game loop as mine but I must say, I love this implicit thing. I don't even think it's particularly difficult to maintain (not more than mine, since I have to take care that, apart from the actions which are executed sequentially, the data structures are not accessed/modified concurrently without synchronization, for example when a new player log in and it's inserted in a room which might be being iterated in a command).

@camlorn: nice stuff really! Scala has been put upper in my TOSTUDY list

Looking at my code again, however, I understood I'll not be changing it, not even with akka. The time is limited and I code comfortably with this approach, so unless I find some performance bottleneck that is implicit with my approach, I'll stick to it. For my next projects, though, I'll treasure the suggestions you've given me. Thank you.
koteko is offline   Reply With Quote