Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I'm writing an ASP.NET page intended for multiple users. On the backend we have datatypes that are primarily mathematical, and interact with Mathematica for string-to-double evaluations, among others. We need to make these evaluations up to 100 times per second per user, for up to 100 users, say. But every time we use NETLink to create a new kernel connection, a new instance of the Mathematica kernel opens on the host machine. 10,000 copies of the Mathematica kernel on a single machine is obviously undesirable.

If we were guaranteed to have one user, it might work to create a global kernel and use that -- but if we have 100 users, that would create 100 kernels, which is still excessive. Is there a nice workaround for this? Perhaps a way to use .NETLink to a kernel that's already opened?

share|improve this question
    
How about defining kernel as singleton and in the kernel define context for each user. –  s.s.o Mar 4 '13 at 10:08
    
Have you looked at webMathematica? It is Java based, so it isn't a perfect fit for your ASP.NET setup, but it has the key feature you seem to need: it provides a queueing system for access to a pool of preinitialized kernels. It is also possible to create webservices which use such a pool of kernels and which your ASP.NET application could use. You even might ask the support at WRI whether it is possible to use only the kernel pool feature from ASP.NET more directly... –  Albert Retey Mar 4 '13 at 10:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.