[Ace-users] [ace-users] Changing the reactor of a svc_handler

Steve Huston shuston at riverace.com
Thu Nov 29 11:04:59 CST 2007


Hi Philippe,
 
You should be aware of the issues due to delayed handler removal, esp
in the case of ACE_WFMO_Reactor. You'd probably do better removing the
DONT_CALL flag from remove_handler() and wait until the handle_close()
callback(s) completed before registering to the new reactor.
 
Please see C++NPv2 chapters 3 and 4 for more details on these issues.
You can learn more about C++NPv2 at
http://www.riverace.com/acebooks/index.htm#cnpv2
 
Best regards,
-Steve

--
Steve Huston, Riverace Corporation
Want to take ACE training on YOUR schedule?
See http://www.riverace.com/training.htm


-----Original Message-----
From: ace-users-bounces at cse.wustl.edu
[mailto:ace-users-bounces at cse.wustl.edu] On Behalf Of ZXERASOGE002,
Ext
Sent: Thursday, November 29, 2007 4:24 AM
To: ace-users at cse.wustl.edu
Subject: [ace-users] Changing the reactor of a svc_handler



Hi, 
I would like to do the following, can you tell me if the idea is
correct, risky or even impossible ? 

I have a subclass of Svc_Handler, which is bound to a reactor. At some
point, I would like to affect it to another reactor, which is running
in another thread. To do this, I would first detach the handler from
the first reactor with Reactor::remove_handler( myhandle,
ALL_EVENTS_MASK | DONT_CALL), pass a pointer on my handler to a second
thread through a message queue, and then reattach the handler to the
second reactor using Reactor::register_handler( myhandle, oldmask).

Is this a correct way to change my handler of thread/reactor ? Are
there any potential problem I should be aware of while doing this ?

regards, 

--- 
Philippe David 
SOGETI High Tech 

Ce courriel (incluant ses eventuelles pieces jointes) peut contenir
des informations confidentielles et/ou protegees ou dont la diffusion
est restreinte. Si vous avez recu ce courriel par erreur, vous ne
devez ni le copier, ni l'utiliser, ni en divulguer le contenu a
quiconque. Merci d'en avertir immediatement l'expediteur et d'effacer
ce courriel de votre systeme. Astrium decline toute responsabilite en
cas de corruption par virus, d'alteration ou de falsification de ce
courriel lors de sa transmission par voie electronique.
	
This email (including any attachments) may contain confidential and/or
privileged information or information otherwise protected from
disclosure. If you are not the intended recipient, please notify the
sender immediately, do not copy this message or any attachments and do
not use it for any purpose or disclose its content to any person, but
delete this message and any attachments from your system. Astrium
disclaims any and all liability if this email transmission was virus
corrupted, altered or falsified.
---------------------------------------------------------------------
Astrium SAS (393 341 516 RCS Paris) - Siege social: 6 rue Laurent
Pichat, 75016 Paris, France
	

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.isis.vanderbilt.edu/pipermail/ace-users/attachments/20071129/be28fb3d/attachment.html 


More information about the Ace-users mailing list