[Ace-users] [ace-users] Task name in VxWorks
Douglas C. Schmidt
schmidt at dre.vanderbilt.edu
Mon Oct 8 08:24:08 CDT 2007
Hi Alex,
Thank for using the PRF.
> ACE VERSION: 5.5
Please upgrade to ACE+TAO+CIAO x.6.1 (i.e., ACE 5.6.1, TAO 1.6.1, and
CIAO 0.6.1), which you can download from
http://download.dre.vanderbilt.edu
under the heading: "Latest Beta Kit."
The DOC groups at Washington University, UC Irvine, and Vanderbilt
University only provide "best effort" support for non-sponsors for the
latest release, as described in
http://www.dre.vanderbilt.edu/~schmidt/DOC_ROOT/ACE/docs/ACE-bug-process.html
Thus, if you need more "predictable" help for earlier versions of
ACE+TAO, I recommend that you check out
http://www.dre.vanderbilt.edu/support.html
for a list of companies that will provide you with ACE+TAO commercial
support.
> HOST MACHINE and OPERATING SYSTEM:
> WindowsXP , SP2
> Winsock2
>
>
> TARGET MACHINE and OPERATING SYSTEM,
> PPC , VxWorks 5.5/ Tornado 2.2.1
> COMPILER NAME AND VERSION (AND PATCHLEVEL): gcc 2.96
>
> CONTENTS OF $ACE_ROOT/ace/config.h
> config-vxworks5.x
>
> CONTENTS OF $ACE_ROOT/include/makeinclude/platform_macros.GNU
> (unless
> this isn't used in this case, e.g., with Microsoft Visual C++):
>
> AREA/CLASS/EXAMPLE AFFECTED:
> None
>
> DOES THE PROBLEM AFFECT:
> OTHER (please specify)?
> Task name in VxWorks
>
> SYNOPSIS:
> [Brief description of the problem]
>
> DESCRIPTION:
> How I can define task ( thread ) name during creation in
> VxWorks?
>
> I succeded to give task name using ACE_thread_t argument in
> spawn function.
>
> But my code runs on VxWorks and Windows XP and I didn't find
> cross
> platform way ( without using #ifdef VXWORKS ) to solve this
> problem
>
> SAMPLE FIX/WORKAROUND:
>
> std::string thread_name("My Thread") ;
>
> char* p_thread_name = (char*)thread_name.c_str() ;
>
> ACE_Thread_Manager::instance()->spawn (
> ACE_THR_FUNC( server) ,
> reinterpret_cast<void*>(thread_arg) ,
> THR_NEW_LWP | THR_DEAMON
>
> #ifdef VXWORKS
>
> | VX_FP_TASK , &p_thread_name
>
> #endif
>
> ) ;
>
> In this way thread_name and p_thread_name is unused variables in
> Windows XP.
>
> May be somebody can advise portable solution?
I don't see an easy way to make this 100% portable since the operating
systems simply have different types for thread id. If you see a way to
do this please let us know.
Thanks,
Doug
More information about the Ace-users
mailing list