Root server

Hello,

We have developed a body of code using root that is primarily used as an interactive program. A front-end gui allows the user to open input files, display and interact with the data and perform various analysis tasks and save output files that are used by other programs. We are considering the possibility of creating a “root server” that would allow these other programs to drive the analysis directly and get results using sockets. As long as there is only a single client thats driving a single analysis from a single file, there should be no problem. My question is: Is it possible for a single process (my gui-less, CINT-less root server) to handle different analysis tasks as different threads? For example, there are numerous globals, like gFile and gDirectory. Does this mean that my server could not simultaneously be processing request from 2 client connections on 2 different root files?

Thanks
Ed Oltman

Hi Ed,

yes, this would be a problem (for the time being as long as several more globals are not protected). However, it should not be a problem to make a so called iterative server that will fork a new version for each connection. Also your rootserver will not be CINT less since you cannot have any ROOT based program without CINT. A lot of what this rootserver has to do is already implemented by the PROOF server, which allows the full power of ROOT on a remote display-less machine.

Cheers, Fons.

Forking a new version (e.g. process?) for each connection seems like a good idea. IS there documentation beyond the July 2004 User’s guide you could point me to that discusses the proof server?

I am using win32 root vversion 4.00/8.

On a related note: I envisioned this server as having 2 main threads: one would listen on a socket for requests. If the request is simply to get some data, this listener thread gets the data, generates a response packet and sends it back. If the request was to do some work, it would write the work request to a message queue and generate a prompt response packet that says “got your request, I’m working on it…”. Meanwhile, the other thread would simple read the message queue (or block if its empty) and do what is requested of it. Its not clear to me if there is thread support available on win32 - certainly not without some ./configure switches…

The spyserv example on the tutorials looks interesting, but it would require my worker thread to constantly pole the TMonitor object. What about the recent addition of the TMonitor::Ready() signal - are signal/slot communications pre-emptive/asynchronous? Or do they work because somewhere within root some sort of polling is done?

Thanks
Ed

Hi Ed,

there is not much more doc than what you have seen and the code (of course). Currently the proofd process which does the authentication before firing proofserv does not yet work on Win32.

Concerning TThread’s on Win32, our Win32 guru Bertrand Bellenot is just finishing the port and it should hopefully appear in the coming monthly release.

TMonitor does now support signal/slots but it does not do any polling. It uses select() which does not take CPU while waiting for activity. Once active it detected and select returns the signal is synchronously emitted.

Cheers, Fons.