*
The moose likes Scala and the fly likes What would be the best way to combine Actors and Sockets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » Scala
Bookmark "What would be the best way to combine Actors and Sockets" Watch "What would be the best way to combine Actors and Sockets" New topic
Author

What would be the best way to combine Actors and Sockets

Sebastian Meyer
Greenhorn

Joined: Aug 01, 2008
Posts: 2
Hi everybody and Venkat,
short question: what would be the best way to create a socket-server with actors? My Impression is that even if I use a SocketServer or a NIO Variant like Netty I'm still bound to thier concurreny model of handling incoming connections. Are there any best practices to realize such a "Actor-Socket-Server"?
Marco Ehrentreich
best scout
Bartender

Joined: Mar 07, 2007
Posts: 1282

Hi Sebastian,

I think in general the implementation regarding resource handling and others aspects should be the same as for any existing (successful) server/socket library. In my understanding the only thing that obviously have to be changed is the way how concurrent requests can be handled with actors. Unfortunately I'm not yet very familiar with actors so I maybe don't see all details but I can't imagine why a socket server library based on Actors should be so much different.

Marco
Alan James Kent
Greenhorn

Joined: Oct 07, 2009
Posts: 1
I just came across http://blogs.sun.com/schmidtm/resource/nio-whitepaper/High-Performance-TCPIP-JVM.edit.Final.Formatted.pdf which looked interesting. Had sample code. But I found the results hard to interpret. Seemed to be saying good things about Scala, but that the example code performance was twice as slow for low loads (?!).
Marco Ehrentreich
best scout
Bartender

Joined: Mar 07, 2007
Posts: 1282

Hi Alan,

welcome to JavaRanch

And thanks for this article. The results of the benchmark, although not very realistic as pointed out by the author, are really interesting. At least it's nice to see how the actors concept performs at high concurrent loads. I'd still like to hear why there's such a big difference in performance under low load levels I guess it's nothing specific to networking applications but instead some general overhead in the actor based design which is compensated with increasing concurrency levels. Hopefully anyone here could explain where the performance difference comes from!

Marco
 
 
subject: What would be the best way to combine Actors and Sockets