Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

proper cleanup of ace server with multiple ace tasks

0 views
Skip to first unread message

sunil

unread,
Nov 20, 2009, 10:30:11 AM11/20/09
to
Hi,
We have a multi threaded ACE server that runs on unix. Main thread
runs the reactor event loop and handles all socket communication. A
processing thread(ACE_Task configured with single thread that runs in
DETACHED mode) processes requests enqueued by main thread. There is a
timer thread (ACE_Thread_Timer_Queue_ Adapter) that handles all
timeout requests. When the server is coming down processing thread
has to do some operations: write some data to database, dump some data
to files,etc. If we use "kill" unix command to kill the server, it
seems to be sending SIGTERM to all the ACE_Tasks(threads) and cleanup
is not proper (please confirm if this behavior is correct for
ACE_Tasks, this happens even though I install signal handler in main
thread(main() routine before I start() ace_tasks) using signal
(SIGTERM, signalHandler)). Whats the correct way to accomplish the
cleanup so that only main thread receives signals and sends shutdown
messages to other threads so that they can do an orderly cleanup.
Thanks Much,
Sunil

Douglas C. Schmidt

unread,
Nov 20, 2009, 10:56:48 AM11/20/09
to sunilsree...@yahoo.com, ace-...@cse.wustl.edu
Hi Sunil,

To ensure that we have proper version/platform/compiler information,
please make sure you fill out the appropriate problem report form
(PRF), which is in

$ACE_ROOT/PROBLEM-REPORT-FORM
$TAO_ROOT/PROBLEM-REPORT-FORM

or in

$ACE_ROOT/BUG-REPORT-FORM
$TAO_ROOT/BUG-REPORT-FORM

in older versions of ACE+TAO. Make sure to include this information
when asking any questions about ACE+TAO since otherwise we have to
"guess" what version/platform/compiler/options you've using, which is
very error-prone and slows down our responsiveness. If you don't use
the PRF, therefore, it is less likely that someone from the core
ACE+TAO developer team will be able to answer your question.
Naturally, we encourage and appreciate other members of the ACE+TAO
user community who can respond to questions that they have the answers
to.

You need to "block" the signals in all the other threads and use
ACE_OS::sigwait(). Check out

ACE_ROOT/tests/Signal_Test.cpp

for an example of how this works.

Thanks,

Doug
--
Dr. Douglas C. Schmidt Professor and Associate Chair
Electrical Engineering and Computer Science TEL: (615) 343-8197
Vanderbilt University WEB: www.dre.vanderbilt.edu/~schmidt
Nashville, TN 37203 NET: d.sc...@vanderbilt.edu

0 new messages