Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Forth > Re: forth and v...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 13 of 13 Topic 4024 of 4053
Post > Topic >>

Re: forth and virtual memory

by gavino <gavcomedy@[EMAIL PROTECTED] > Apr 28, 2008 at 03:08 PM

On Apr 28, 1:21 pm, Thomas Pornin <por...@[EMAIL PROTECTED]
> wrote:
> According to gavino  <gavcom...@[EMAIL PROTECTED]
>:
>
> >http://varnish.projects.linpro.no/wiki/ArchitectNotes
>
> > This is an impressive read........they guy seems to do some smart
> > things by letting the os kernel do a lot of the work its designed for
> > and he does some tricks to avoid systems calls and keepign things in
> > filesystems that are expensive.
>
> Another way to see this text is the following: this guy read the man
> page for the mmap() system call and thought he was Enlightened. He's not
> the first. Using a file-backed memory area and relying on the kernel and
> the MMU to move things around between the RAM and the disk is not a new
> idea. I even did it myself ten years ago when writing a C preprocessor
> (I had weird hobbies at that time), and that was no invention of mine
> either.
>
> That technique is no silver bullet. On a modern operating system, the
> part which handles the MMU (often dubbed the "kernel") tries to do smart
> things when it comes to deciding which chunk of data should reside in
> RAM and which should not; but it does so "generically", without really
> knowing what the application will do. Distinct applications have
> distinct access patterns and distinct needs. Letting the kernel do the
> job means that you believe in the "one size fits all" concept, which
> often turns out to have only limited applicability to what is
> colloquially known as the "real world".
>
> Filling a file from a virtual memory view also often leads to high
> filesystem fragmentation, unless you preallocate the complete file,
> which is almost invariably a waste of space on a non-dedicated system.
> Besides, relying entirely on the MMU means that you merge the adresse
> space and the disk space, which implies that on a 32-bit system, you
> will have trouble handling more than 2 gigabytes of data.
>
> Some research projects have gone much farther along those lines. For
> instance, the EROS operating system was built around the idea of
> "checkpointing", in which not only the RAM is used as a cache over the
> disk, but the system arranges to save its complete state at regular
> intervals, transactionaly, so that power failures can be mostly ignored;
> this can be achieved efficently with the MMU. The EROS project was
> launched in 1991.
>
> That modern systems have layers of cache to cope with a slow RAM and
> very slow disk is not a novel idea either. It is true -- and the guy is
> right to mind cache issues -- but as far as I can see, the world of
> programming did not wait for him to get the point.
>
> > Can forth use this level of detail when it exists on linux?  How does
> > forth interact with virtual memory?
>
> The issue is mostly orthogonal. On a Linux system, the kernel handles
> the MMU, and applications talk to the kernel through system calls
> (namely, software-triggered interrupts). Low-level programming languages
> allow the application programmer to issue direct system calls, and Forth
> is not different from C in that respect.
>
> Of course, most of Forth usage is done on much smaller systems which do
> not have a MMU, and usually no disk either. Which makes the whole point
> quite moot.
>
> There _are_ some cache-related optimizations which are not directly
> usable in Forth -- and not in C either. As was pointed out before, cache
> issues dominate the question of performance in most cpu-intensive tasks.
> Best performance is achieved when memory accesses are performed in a way
> which fits well the behaviour of caches. When the programmer uses a
> strongly-typed programming language, it becomes possible for the
> operating system (or virtual machine implementation) to actually _move_
> objects in RAM dynamically to better fit the access patterns. This is a
> feature of modern Garbage Collectors and is applicable only if the GC
> precisely knows which data element is a pointer and which is not
> (because moving an object also means adjusting the references to that
> object). Standard Forth is somewhat typeless; a GC for Forth has been
> published, but it is a conservative GC which does not move objects
> around. There are some Forth-like systems with types, which may allow
> for advanced GC techniques (e.g. StrongForth).
>
> If simply using mmap() is 2006-programming, then improved cache
> coherency through an object-moving GC must be from year 2015, at least.
> Strangely enough, Sun Microsystems has sold the idea at industrial
> levels for the last decade (under the name "Java").
>
>         --Thomas Pornin

wait since this is a cache program it HAS to be good with 2G+ ......




 13 Posts in Topic:
forth and virtual memory
gavino <gavcomedy@[EMA  2008-04-28 12:12:05 
Re: forth and virtual memory
Thomas Pornin <pornin@  2008-04-28 20:21:13 
Re: forth and virtual memory
anton@[EMAIL PROTECTED]   2008-04-30 12:49:08 
Re: forth and virtual memory
Thomas Pornin <pornin@  2008-04-30 15:39:34 
Re: forth and virtual memory
anton@[EMAIL PROTECTED]   2008-05-01 20:55:28 
Re: forth and virtual memory
Thomas Pornin <pornin@  2008-05-01 23:39:16 
Re: forth and virtual memory
anton@[EMAIL PROTECTED]   2008-05-02 16:11:42 
Re: forth and virtual memory
Thomas Pornin <pornin@  2008-05-02 20:51:07 
Re: forth and virtual memory
Andrew Haley <andrew29  2008-04-30 10:46:28 
Re: forth and virtual memory
anton@[EMAIL PROTECTED]   2008-05-01 20:45:43 
Re: forth and virtual memory
Andrew Haley <andrew29  2008-05-02 04:22:48 
Re: forth and virtual memory
gavino <gavcomedy@[EMA  2008-04-28 15:00:41 
Re: forth and virtual memory
gavino <gavcomedy@[EMA  2008-04-28 15:08:21 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri May 16 10:12:30 CDT 2008.