Hi,

Following are some thoughts about the threading issues in Axis2/C.

Most of the Axis2 core components are thread independent and hence we don't have problems. But the important thing is, we have to make sure that they are thread safe in C implementation.

According to the sequence, I have identified the HTTP worker is invoked to create the message context and process the request for each request. The HTTPWorker calls the HTTPTransportUtils class to process the request in Axis2 Java implementation. HTTPTransportUtils is the one who creates the engine and handover the control to the engine to process that particular request. So starting from the HTTPWorker we can consider all the classes in downstream as thread independent, but we have to make sure that they are thread safe. In the case of the Simple Axis Sever (or the SimpleHTTPServer), we have to use threads. It is the one who first receives the request, and for each request it has to create a thread to serve that particular request. Inside this thread, we can create a HTTP worker to handle the request. The threads that are used in here can be platform specific implementation of threads (i.e. ptheads, Win32 threads).

So the HTTP transport will be in two major components. The binary that creates the server, and the library (dynamic) which contains the worker and the utility functions. Since the utility functions and the worker are thread independent, we will be able to use the same library when we are writing the plug-in for the Apache HTTPD.

As we go ahead I am planning to write a wrapper for the thread package, so the thread package is user-pluggable. The wrapper contains general functions required from any thread package (eg: thread_create(), thread_stop() ... etc.). The simple axis server uses the general functions in this wrapper and the package specific wrappers will convert these general calls to package specific calls.

Please feel free to comment on the design.


Thanks

Sahan

Reply via email to