[Ace-users] [ace-users] Proactor on WIN32 with multiprocessor Xeon - anyonegot this working?

JR Andreassen janrune at io.com
Tue Jan 29 14:17:08 CST 2008

 I solved this problem by broadcasting a shutdown:
Like such:
broadcastSignal(SIGTERM, 0);
// --------------------------------------------------------------
 * Broadcast Signal(sig) to all tasks
 * @param sig                Signal to broadcast.
 * @param ignored_suspended    Flag to determine wether to ignore 
suspended tasks.
 * @return int Number ot tasks notified.
int broadcastSignal(int signum, int ignored_suspended)
    int retVal = 0;
    ACE_Service_Object* svoTest = NULL;
    ACE_Event_Handler*    handler = NULL;
    ACE_Task_Base*        taskbase = NULL;
    ACE_Service_Repository* svcs_repository = 
    const ACE_Service_Type_Impl *    srpI = NULL;
    const ACE_Service_Type*            srp = NULL;
    if(svcs_repository != NULL)
        ACE_Service_Repository_Iterator repIter(*svcs_repository, 
        for(;repIter.next(srp) > 0;repIter.advance())
            srpI = srp->type();
                svoTest = static_cast<ACE_Service_Object*>(srpI->object());
                    handler = dynamic_cast<ACE_Event_Handler*>(svoTest);
                    if(!ISNULL    (handler))
                    {    handler->handle_signal(signum);      }
    return retVal;

Alexander Libman wrote:

>Hi Chris,
>The Proactor_Test does not perform gracefull shutdown.
>It may work for single CPU platform, but easily can have access violation on
>multi-CPU box.
>The problem is that   Proactor_Test starts to delete Client/Server instances
>while completion callbacks can be active
>in Proactor_Task  thread pool.
>The correct solution  can be  two step shutdown process:
>a) initiate cancellation of all pending operation using cancel() and
>closesocket() methods
>   (you should use both of them as Windows CancelIO() could have no effect )
>b) waiting on special event/condition when all Clients/Servers are
>ace-users mailing list
>ace-users at mail.cse.wustl.edu

More information about the Ace-users mailing list