Darin C. Partridge (darin++at++paradox.idec.sdl.usu.edu)
Fri, 9 Jun 1995 08:33:04 -0600
I recently had this problem. I wanted to monitor and control the performer
application from an unrelated process. I didn't want any performer code
in the unrelated process but as it turned out, I did use a performer call
or two.
I set up the arena in the unrelated process as follows:
****************************************************************************
usconfig(CONF_ATTACHADDR,0x7f000000); /* Thank you Jim Helman */
control_pool = pfNewDPool( sizeof(control_struct_t)+256, "viperfly" );
usconfig(CONF_ATTACHADDR,0x0);
shmem = pfDPoolAlloc( control_pool, sizeof(control_struct_t), 0 );
if( shmem == NULL )
printf( "unable to init shared mem.\n" ), exit(1);
ctl = (control_struct_t*)shmem;
****************************************************************************
So pfNewDPool, and pfDPoolAlloc are the only performer calls in the unrelated
process.
I attached my performer application as follows:
****************************************************************************
ViewState->control_pool = pfAttachDPool( "viperfly" );
ViewState->shmem = pfDPoolFind( ViewState->control_pool, 0 );
ViewState->ctl = (control_struct_t*)ViewState->shmem;
****************************************************************************
So I made a small shared arena that my performer app has a pointer to
in its big common arena (ViewState is shared memory for my performer app).
Remember to use pfDPoolLock, and pfDPoolUnlock when modifying (not reading)
variables from your shared arena. It works like a dream for me.
Darin
--
_ _
__(_)__ ,,, __(_)__
(_______) (o o) (_______)
| |-------------------------------------oOO--(_)--OOo--| |
| | Darin C. Partridge _________ | |
| | Space Dynamics Laboratory (CSD) | | | |
| | 1695 North Research Parkway | Gone | | |
| | Logan, UT 84321 | Fishing | | |
| | |_________| | |
| | Voice: (801) 755-4348 ____________ | |
| | Fax: (801) 755-4366 /___________/ | |
| | Email: darin++at++sdl.usu.edu | |
|_____|----------------------------------------------------|_____|
(_____) (http://www.csd.sdl.usu.edu/darin_exec/homedoc) (_____)
(_) (_)
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:51:35 PDT