To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.devOpen lugnet.cad.dev in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / 10459
10458  |  10460
Subject: 
Re: MPD file loading search order
Newsgroups: 
lugnet.cad.dev
Date: 
Thu, 27 Jul 2006 08:59:53 GMT
Viewed: 
2528 times
  
In lugnet.cad.dev, Anders Isaksson wrote:
Tim Gould wrote:
In lugnet.cad.dev, Anders Isaksson wrote:

What about the following algorithm (assuming everything is cached):

- whenever a file reference is read, search for the file in the
  cache. if not found, add it as an empty file and flag it as
'incomplete'

- whenever a 'file' is seen, search for it in the cache.
  if not found, add it
  if found, but 'incomplete', update it

Where does a second pass enter in this?

That is a two pass algorithm. It's optimised by only searching files
that have already appeared but the search in stage II is a second
pass.

Actually I can't get my head around 'searching for a file in the cache' as
equivalent to 'do a second pass of the source file'. Every part is searched
for in the cache. Each source line is only read and parsed once. What am I
not understanding?

I suspect there's two definitions of "pass" at work here. I would consider a two
pass algorithm to be anything requiring two loops (which we must have either way
as their is no reference order specified in MPDs). Another way of considering it
is the number of times you read the file (or a cached version of it). The latter
would be a very inefficient way of reading an MPD and the former fits what you
proposed.

Tim



Message has 1 Reply:
  Re: MPD file loading search order
 
(...) Probably. As I was reading the thread it was *loading* the MPD file that was considered two-pass, and my algorithm is definitely only one-pass for that (and no extra fixups after reading it all). OTOH, if the file should be rendered on screen (...) (18 years ago, 27-Jul-06, to lugnet.cad.dev)

Message is in Reply To:
  Re: MPD file loading search order
 
(...) Actually I can't get my head around 'searching for a file in the cache' as equivalent to 'do a second pass of the source file'. Every part is searched for in the cache. Each source line is only read and parsed once. What am I not (...) (18 years ago, 26-Jul-06, to lugnet.cad.dev)

29 Messages in This Thread:








Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR