You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by da...@apache.org on 2009/03/25 10:03:21 UTC
svn commit: r758181 - in
/webservices/axis2/branches/c/new_thread_pool-25march2009:
src/core/clientapi/ src/core/transport/http/receiver/
src/core/transport/http/server/apache2/
src/core/transport/http/server/simple_axis2_server/ tools/tcpmon/src/
Author: damitha
Date: Wed Mar 25 09:03:14 2009
New Revision: 758181
URL: http://svn.apache.org/viewvc?rev=758181&view=rev
Log:
Changes regarding the new thread pool
Modified:
webservices/axis2/branches/c/new_thread_pool-25march2009/src/core/clientapi/listener_manager.c
webservices/axis2/branches/c/new_thread_pool-25march2009/src/core/clientapi/op_client.c
webservices/axis2/branches/c/new_thread_pool-25march2009/src/core/transport/http/receiver/http_svr_thread.c
webservices/axis2/branches/c/new_thread_pool-25march2009/src/core/transport/http/server/apache2/mod_axis2.c
webservices/axis2/branches/c/new_thread_pool-25march2009/src/core/transport/http/server/simple_axis2_server/http_server_main.c
webservices/axis2/branches/c/new_thread_pool-25march2009/tools/tcpmon/src/session.c
Modified: webservices/axis2/branches/c/new_thread_pool-25march2009/src/core/clientapi/listener_manager.c
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/new_thread_pool-25march2009/src/core/clientapi/listener_manager.c?rev=758181&r1=758180&r2=758181&view=diff
==============================================================================
--- webservices/axis2/branches/c/new_thread_pool-25march2009/src/core/clientapi/listener_manager.c (original)
+++ webservices/axis2/branches/c/new_thread_pool-25march2009/src/core/clientapi/listener_manager.c Wed Mar 25 09:03:14 2009
@@ -127,7 +127,6 @@
listener = axis2_transport_in_desc_get_recv(transport_in, env);
if (listener)
{
- axutil_thread_t *worker_thread = NULL;
axis2_listener_manager_worker_func_args_t *arg_list = NULL;
arg_list = AXIS2_MALLOC(env->allocator,
sizeof
@@ -144,21 +143,8 @@
#ifdef AXIS2_SVR_MULTI_THREADED
if (env->thread_pool)
{
- worker_thread =
- axutil_thread_pool_get_thread(env->thread_pool,
- axis2_listener_manager_worker_func,
- (void *) arg_list);
- if (!worker_thread)
- {
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
- "Thread creation failed"
- "Invoke non blocking failed");
- }
- else
- {
- axutil_thread_pool_thread_detach(env->thread_pool,
- worker_thread);
- }
+ axutil_thread_pool_dispatch(env->thread_pool,
+ axis2_listener_manager_worker_func, (void *) arg_list);
}
else
{
Modified: webservices/axis2/branches/c/new_thread_pool-25march2009/src/core/clientapi/op_client.c
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/new_thread_pool-25march2009/src/core/clientapi/op_client.c?rev=758181&r1=758180&r2=758181&view=diff
==============================================================================
--- webservices/axis2/branches/c/new_thread_pool-25march2009/src/core/clientapi/op_client.c (original)
+++ webservices/axis2/branches/c/new_thread_pool-25march2009/src/core/clientapi/op_client.c Wed Mar 25 09:03:14 2009
@@ -531,7 +531,6 @@
}
else
{
- axutil_thread_t *worker_thread = NULL;
axis2_op_client_worker_func_args_t *arg_list = NULL;
arg_list = AXIS2_MALLOC(env->allocator,
sizeof(axis2_op_client_worker_func_args_t));
@@ -549,20 +548,8 @@
#ifdef AXIS2_SVR_MULTI_THREADED
if (env->thread_pool)
{
- worker_thread = axutil_thread_pool_get_thread(env->thread_pool,
- axis2_op_client_worker_func,
- (void *)
- arg_list);
- if (!worker_thread)
- {
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
- "Thread creation failed call invoke non blocking");
- }
- else
- {
- axutil_thread_pool_thread_detach(env->thread_pool,
- worker_thread);
- }
+ axutil_thread_pool_dispatch(env->thread_pool, axis2_op_client_worker_func,
+ (void *) arg_list);
}
else
{
@@ -726,7 +713,7 @@
axutil_free_thread_env(th_env);
th_env = NULL;
}
- axutil_thread_pool_exit_thread(th_pool, thd);
+ /*axutil_thread_pool_exit_thread(th_pool, thd);*/
return NULL;
}
Modified: webservices/axis2/branches/c/new_thread_pool-25march2009/src/core/transport/http/receiver/http_svr_thread.c
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/new_thread_pool-25march2009/src/core/transport/http/receiver/http_svr_thread.c?rev=758181&r1=758180&r2=758181&view=diff
==============================================================================
--- webservices/axis2/branches/c/new_thread_pool-25march2009/src/core/transport/http/receiver/http_svr_thread.c (original)
+++ webservices/axis2/branches/c/new_thread_pool-25march2009/src/core/transport/http/receiver/http_svr_thread.c Wed Mar 25 09:03:14 2009
@@ -28,6 +28,7 @@
#include <axutil_error_default.h>
#include <axiom_xml_reader.h>
#include <signal.h>
+#include <stdio.h>
AXIS2_EXPORT int axis2_http_socket_read_timeout = AXIS2_HTTP_DEFAULT_SO_TIMEOUT;
@@ -123,7 +124,6 @@
{
int socket = -1;
axis2_http_svr_thd_args_t *arg_list = NULL;
- axutil_thread_t *worker_thread = NULL;
socket = (int)axutil_network_handler_svr_socket_accept(env,
svr_thread->
@@ -148,16 +148,8 @@
arg_list->socket = socket;
arg_list->worker = svr_thread->worker;
#ifdef AXIS2_SVR_MULTI_THREADED
- worker_thread = axutil_thread_pool_get_thread(env->thread_pool,
- axis2_svr_thread_worker_func,
- (void *) arg_list);
- if (!worker_thread)
- {
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Thread creation failed"
- "server thread loop");
- continue;
- }
- axutil_thread_pool_thread_detach(env->thread_pool, worker_thread);
+ axutil_thread_pool_dispatch(env->thread_pool, axis2_svr_thread_worker_func,
+ (void *) arg_list);
#else
axis2_svr_thread_worker_func(NULL, (void *) arg_list);
#endif
@@ -300,7 +292,7 @@
}
#ifdef AXIS2_SVR_MULTI_THREADED
- axutil_thread_pool_exit_thread(env->thread_pool, thd);
+ /*axutil_thread_pool_exit_thread(env->thread_pool, thd);*/
#endif
return NULL;
Modified: webservices/axis2/branches/c/new_thread_pool-25march2009/src/core/transport/http/server/apache2/mod_axis2.c
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/new_thread_pool-25march2009/src/core/transport/http/server/apache2/mod_axis2.c?rev=758181&r1=758180&r2=758181&view=diff
==============================================================================
--- webservices/axis2/branches/c/new_thread_pool-25march2009/src/core/transport/http/server/apache2/mod_axis2.c (original)
+++ webservices/axis2/branches/c/new_thread_pool-25march2009/src/core/transport/http/server/apache2/mod_axis2.c Wed Mar 25 09:03:14 2009
@@ -32,6 +32,8 @@
#include <apr_shm.h>
#include <axis2_http_transport.h>
+#define INIT_THREAD_POOL_SIZE 150
+
/* Configuration structure populated by apache2.conf */
typedef struct axis2_config_rec
{
@@ -549,7 +551,7 @@
"[Axis2] Error creating mod_axis2 log structure");
exit(APEXIT_CHILDFATAL);
}
- thread_pool = axutil_thread_pool_init(allocator);
+ thread_pool = axutil_thread_pool_init(allocator, INIT_THREAD_POOL_SIZE);
if (!thread_pool)
{
ap_log_error(APLOG_MARK, APLOG_EMERG, APR_EGENERAL, svr_rec,
@@ -667,7 +669,7 @@
"[Axis2] Error creating mod_axis2 log structure");
exit(APEXIT_CHILDFATAL);
}
- thread_pool = axutil_thread_pool_init(allocator);
+ thread_pool = axutil_thread_pool_init(allocator, INIT_THREAD_POOL_SIZE);
if (! thread_pool)
{
ap_log_error(APLOG_MARK, APLOG_EMERG, APR_EGENERAL, svr_rec,
Modified: webservices/axis2/branches/c/new_thread_pool-25march2009/src/core/transport/http/server/simple_axis2_server/http_server_main.c
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/new_thread_pool-25march2009/src/core/transport/http/server/simple_axis2_server/http_server_main.c?rev=758181&r1=758180&r2=758181&view=diff
==============================================================================
--- webservices/axis2/branches/c/new_thread_pool-25march2009/src/core/transport/http/server/simple_axis2_server/http_server_main.c (original)
+++ webservices/axis2/branches/c/new_thread_pool-25march2009/src/core/transport/http/server/simple_axis2_server/http_server_main.c Wed Mar 25 09:03:14 2009
@@ -36,6 +36,7 @@
AXIS2_IMPORT extern axis2_char_t *axis2_request_url_prefix;
#define DEFAULT_REPO_PATH "../"
+#define INIT_THREAD_POOL_SIZE 150
/***************************** Function headers *******************************/
axutil_env_t *init_syetem_env(
@@ -63,7 +64,7 @@
/* if (!log) */
/* log = axutil_log_create_default (allocator); */
- axutil_thread_pool_t *thread_pool = axutil_thread_pool_init(allocator);
+ axutil_thread_pool_t *thread_pool = axutil_thread_pool_init(allocator, INIT_THREAD_POOL_SIZE);
/* We need to init the parser in main thread before spawning child
* threads
*/
Modified: webservices/axis2/branches/c/new_thread_pool-25march2009/tools/tcpmon/src/session.c
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/new_thread_pool-25march2009/tools/tcpmon/src/session.c?rev=758181&r1=758180&r2=758181&view=diff
==============================================================================
--- webservices/axis2/branches/c/new_thread_pool-25march2009/tools/tcpmon/src/session.c (original)
+++ webservices/axis2/branches/c/new_thread_pool-25march2009/tools/tcpmon/src/session.c Wed Mar 25 09:03:14 2009
@@ -57,7 +57,6 @@
#define AXIS2_INTF_TO_IMPL(session) \
((tcpmon_session_impl_t *) session)
-axutil_thread_t *server_thread = NULL;
tcpmon_session_server_thread_data_t *thread_data = NULL;
@@ -410,21 +409,7 @@
thread_data->env = env;
session_impl->is_running = AXIS2_TRUE;
- server_thread = axutil_thread_pool_get_thread(env->thread_pool,
- server_funct,
- (void *) thread_data);
- if (!server_thread)
- {
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Thread creation failed"
- "server thread");
- if (session_impl->on_trans_fault_funct)
- {
- (session_impl->on_trans_fault_funct) (env,
- "error in creating the server thread");
- }
- }
-
- axutil_thread_pool_thread_detach(env->thread_pool, server_thread);
+ axutil_thread_pool_dispatch(env->thread_pool, server_funct, (void *) thread_data);
return AXIS2_SUCCESS;
}
@@ -440,11 +425,6 @@
session_impl = AXIS2_INTF_TO_IMPL(session);
session_impl->is_running = AXIS2_FALSE;
- if (server_thread)
- {
- AXIS2_FREE(env->allocator, server_thread);
- server_thread = NULL;
- }
if (thread_data)
{
AXIS2_FREE(env->allocator, (tcpmon_session_server_thread_data_t *)thread_data);
@@ -498,7 +478,6 @@
const axutil_env_t *env = NULL;
int listen_socket = -1;
int socket = -1;
- axutil_thread_t *request_thread = NULL;
tcpmon_entry_request_data_t *request_thread_data = NULL;
session_impl = thread_data->session_impl;
@@ -519,8 +498,6 @@
}
if (thd)
{
- AXIS2_FREE(env->allocator, server_thread);
- server_thread = NULL;
}
if (data)
{
@@ -552,29 +529,12 @@
request_thread_data->socket = socket;
request_thread_data->session = (tcpmon_session_t *) session_impl;
- request_thread = axutil_thread_pool_get_thread(env->thread_pool,
- tcpmon_entry_new_entry_funct,
- (void *)
- request_thread_data);
- if (!request_thread)
- {
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Thread creation failed"
- "request thread");
- if (session_impl->on_trans_fault_funct)
- {
- (session_impl->on_trans_fault_funct) (env,
- "fail in creating the thread");
- }
- break;
- }
-
- axutil_thread_pool_thread_detach(env->thread_pool, request_thread);
+ axutil_thread_pool_dispatch(env->thread_pool, tcpmon_entry_new_entry_funct,
+ (void *) request_thread_data);
}
axutil_network_handler_close_socket(env, listen_socket);
if (thd)
{
- AXIS2_FREE(env->allocator, server_thread);
- server_thread = NULL;
}
if (data)
{