Re: Identifying channels

New Message Reply Date view Thread view Subject view Author view

Drew Hess (dhess++at++vision.arc.nasa.gov)
Tue, 6 Sep 1994 16:02:45 -0700


On Aug 28, 8:58pm, Aaron Hightower wrote:
> Subject: Re: Identifying channels
> > From: "Drew Hess" <dhess++at++vision.arc.nasa.gov>
> > Subject: Identifying channels in callbacks
> >
> > I need a way of uniquely identifying the channel passed to a post/predraw
> > callback in Performer 1.2. According to the man page, the return value of
> > pfNewChan() is a handle to the newly created channel, so it sounds like I
could
> > use the handle for what I need. (What's actually returned is of type
> > (pfChannel *), so should I use the pointer itself to identify the channel
or
> > should I dereference the pointer and use that value? The latter would work
if,
>
> Trying to poke into Performer's data structures is dangerous. The main
reason
> being that using such "undocumented features," if they exist, is no guarantee
> that they will continue to exist in new versions. I would not suggest
> dereferencing any of the Performer objects directly.
>

I agree, which is why I'm using the pointer to identify the channel and not the
dereferenced pointer. The only reason I can see why using the pointer value
would fail is if a) Performer changes the value of the pointer at some time
during the run-time life of the process, or b) the channel is in a shared
memory arena that is mapped to different locations in different processes'
address spaces, and the mapping of pointer->channel ID is created in one
process and used for lookup in another where this aliasing exists.

> > for instance, the pointer points to an integer that's used as a table index
> > into a libpr or libpf internal table.)
>
> There are two ways of handling this that I know of. The first way is simply
> to use pfUserData() on the pfChannel pointer and then make a structure
> that identifies the channel in whatever way you would like.
>

This sounds like a less-kludgy way of accomplishing what I want. I'll look
into it.

Thanks
-dwh-
dhess++at++vision.arc.nasa.gov


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:32 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.