WarpUp (127/442)

From:Joseph Fenton
Date:12 Dec 99 at 02:37:41
Subject:Re: [warpup] Re: GetMsgPPC arguement.

Sam Jordan wrote:
>
> I'm not sure whether the effort of using an asynchronous architecture
> is it really worth. Sure, it should work this way, but IMHO it's
> a lot easier to use the synchron approach. One context switch is
> usually irrelevant and a cross message also doesn't have zero cost
> (although it's faster).

Depends on what you are doing; for something simple,
the one context switch to handle messages is probably
fine. ADoomPPC does this. But, if you are trying
to squeeze every last once of speed out of the PPC,
the async way will give better results.

> >it invalidates the cache for the data area and then fetches
> >data from the data area. A cache invalidation is virtually
> >instantaneous as all it is doing is marking cache entries
> >as not valid... no push-backs or the like are needed.
>
> In theory that's surely right. But what I can say is, that people
> should always try to avoid dealing with caches completely.
> I personally would prefer having one or two more context switches
> rather than have to add cache tricks to my program. Theory is one
> thing, practice another. I consider cache tricks as potentially
> dangerous concerning reliability and stability of applications.

Definately; if you don't know how to handle the cache,
stick to the context switches. You can protect yourself
with the cache functions with semaphores or properly
handled signals, but the other way is a lot less work
and easier to debug. You could design it to use the
context switch initially, then switch to the async design
after you take care of everything else. Remember, get
it working FIRST, optimize SECOND.