[Ace-users] [ace-users] ACE_Task and ACE_Task_Base

Douglas C. Schmidt schmidt at dre.vanderbilt.edu
Mon Feb 25 10:47:05 CST 2008


Hi Jim,

> If I have a class that derives from ACE_Task<ACE_MT_SYNCH> and I call
> activate() on it from main(), then I want to cancel the task from
> running at a certain event (like a keystroke in my case). Is the
> proper way to cancel this task to use ACE_Thread_Manager::instance()-
> >cancel_task(my_task_instance_pointer, 1); ? Does this effectively
> cause svc() in the ACE_Task to complete and return? Is it better to
> make a member function of my class that is a ACE_Task that effectively
> makes svc() return without having to cancel the task from main?

There are examples of canceling tasks in Chapters 6 and 7 of C++NPv2
<www.cs.wustl.edu/~schmidt/ACE/book2/> and canceling threads in Chapter
9 of C++NPv1 <www.cs.wustl.edu/~schmidt/ACE/book1/>.  There are both
OS-dependent and OS-independent says to do this.  To ensure that we have
proper version/platform/compiler information, therefore, 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.

Thanks,

        Doug



More information about the Ace-users mailing list