[erlang-questions] JInterface and multi-threading

Alexander Lamb <>
Wed Apr 23 18:49:26 CEST 2008


Now I have a better understanding of JInterface (from previous post  
answer), I looked into the Java code.

It it is not clear to me if rpc from Jinterface is thread safe. Or, in  
other words, will this be a bottleneck for an application in an app  
server with many concurent users.

Indeed, having only one OtpConnection (which seems logical now), I  
will need to do rpc calls from potentially simultanious threads.
How will this be handled? If one call is taking longer than expected,  
I will block on connection.receiveRPC().

Is there a correct way to handle this problem? Do I need for example  
to create a mailbox in a thread for each session in my server? This  
would allow my Java sesions to run regardless of any other session  
blocking on a call to the erlang server. Now, obviously, my Erlang  
server might be blocked but I could create an Erlang process on the  
server for each client process connecting from Java.

What is the correct way to handle those issues.


Alexander Lamb
Founding Associate

4 ch. de la Tour de Champel
1206 Geneva

Tel:  022 347 77 37
Fax: 022 347 77 38


More information about the erlang-questions mailing list