Index: [thread] [date] [subject] [author]
  From: Jon M. Taylor <taylorj@gaia.ecs.csus.edu>
  To  : ggi-develop@eskimo.com
  Date: Wed, 18 Aug 1999 12:06:12 -0700 (PDT)

Re: Ping-pong buffers on KGIcon are here!

On Wed, 18 Aug 1999, Marcus Sundberg wrote:

> Andreas Beck wrote:
> > 
> > > > The app now tries to lock down a directbuffer. The same as above happens.
> > > > It waits on the accel lock, engages the fb lock, frees the accel lock.
> > > > It draws some stuff on the DB.
> > > > While doing so, it calls a LibGGI primitive with the DB still locked.
> > 
> > > It is essential for Glide and (future) DirectX operation that this
> > > (calling GGI primitives while a DB is acquired) is not allowed.
> > 
> > Why ? At worst, we'd just auto-free the fb for the time the ggi primitive
> > request is executing. Note, that the reaction that follows in the
> > description I gave above, is equivalent to a DB-release, call accel,
> > DB-acquire, due to the synchronous accel operation it induces.
> 
> Becuase:
> a) Acquiring/Releasing the DB may be a very costly operation, it
>    should not be done too much, and definitely not implicitly.
> b) We'd have to stuff unnecessary code in every ggi primitive to
>    check whether any DB is acquired or not.
> c) I see no gain at all in allowing this. Well-written applications
>    simply shouldn't mix DB access with ggi primitives.
> 
> > I am thinking about compatibility here, when wrapper libs (SVGAlib might
> > be a candidate for that) don't have that restriction.
> 
> Then wrapper libs can free/allocate the DB themselves when necessary.
> That is an exception, and not something well-written applications
> should do.

	We have the mansync helper already, perhaps we could use a new
"mandbaccelmutex" helper which would wrap all primitive calls with functions
that would map/unmap the appropriate DBs automatically?  Using this helper,
like using mansync, would be a performance-costly kludge-around, but at least
it would be optional and not interfere with anything when it wasn't being
used.  And, like the mansync helper, its primary role would be to help 
people get legacy code up and running quickly.

Jon

---
'Cloning and the reprogramming of DNA is the first serious step in 
becoming one with God.'
	- Scientist G. Richard Seed


Index: [thread] [date] [subject] [author]