This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What would be the best way to combine Actors and Sockets

 
Sebastian Meyer
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1294
IntelliJ IDE Java Scala
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1294
IntelliJ IDE Java Scala
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic