Re: pfFlux question

New Message Reply Date view Thread view Subject view Author view

Yair Kurzion (yair++at++polygon.engr.sgi.com)
Fri, 22 Jan 1999 10:34:26 -0800 (PST)


> If I were extending the fluxed_gset.C example, what do I do if later on
> I have to modify some of the attributes in the fluxed geoset? For
> instance, what if I need to change the color attribute (PFGS_COLOR4) or
> I need to edit the coordinates within my PFGS_COORD3 list?

> Is it safe for me to modify this stuff once I've done a
> geoset->getWriteableData(), or do I need to flux the attributes as well
> as the geoset?

So, in my last e-mail I explained how some of the attributes can be a single
array pointed to by all the GeoSet copies, while other attributes are a
DIFFERENT array for each copy of the GeoSet.

Trying to draw an example:

               ----> GeoSet(Copy#0) --> CoordArray#0 -
              / \
             / \
FluxedGeoSet ------> GeoSet(Copy#1) --> CoordArray#1 ----> SingleColorArray.
             \ ... /
             \ ... /
              \ ... /
               ----> GeoSet(Copy#n) --> CoordArray#n -

In the drawing, a Fluxed GeoSet has n multibuffer copies. Each one has a private
Coord array, but they all share the same Color array. Such a setup is created by
allocating a new Coord array every time the Flux init routine is invoked, and
using one Color array for all init function invocations.

Modifying the Coord array of a GeoSet copy is safe between the calls to
getWritableData and writeComplete.

Modifying the Color array is never MP safe. It doesn't matter if you called
getWriteableData or not because getWriteableData locks a single copy of the
GeoSet. and the Color array is shared by all.

Of course, modifying the contents of the color array (even though not MP-safe)
will probably not crash your application.

I hope this helps.

-yair

-- 
\_________  \_____  \__    \__  \_____         Yair Kurzion
\_________  \_____   \__   \__  \_____         yair++at++sgi.com
       \__     \__   \____\__      \__   http://reality.sgi.com/yair
       \__          \__  \__                Work: (650) 933-6502
       \__          \__   \__               Home: (408) 226-9771
       \__          \__    \__             

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Fri Jan 22 1999 - 10:34:27 PST

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