Re: Reconciling Garbage Collection with Deterministic Finalization
- From: davids@xxxxxxxxxxxxx
- Date: 9 Apr 2006 17:53:42 -0700
Except for hard real-time applications, page faults are not much
of a problem, since they are guaranteed to only block for a short
time (even if there is a disk error, since then the process will be
terminated). There is obviously some latency associated with
servicing a page fault, but this is unavoidable regardless of the
concurrency design.
I don't see how you can argue that the latency of a page fault is
unavoidable. A page fault only stalls the faulting thread. A design
that permanently associates resources to threads, for example, will be
more crippled by a page fault than a design that allows whatever thread
happens to be running to grab a resource and handle it.
Consider, as an extreme example, two designs for the same server. They
both handle 10,000 clients with 100 threads. In one design, each client
is permanently assigned to a thread, 10 to each. In another design, the
clients that need work are put on a queue and a thread grabs a client
whenever it's free.
In the first design, if one client does something really unusual, that
causes code to fault in that isn't resident in memory, nine other
arbitrary connections will be stalled until the code faults in as well
as the client that triggered the fault. In the second design, the fault
will only affect the client that caused it (which did something rare
and unusual anyway), and other clients can be services by other
threads.
Consider also code that handles unusual error conditions. This type of
code is more likely to encounter page faults because the code is less
frequently used and less likely to be in memory. You can enter this
code while holding critical locks (thus stalling other threads while
the page fault is services) or you can carefully avoid doing so
(perhaps even dropping the lock and then re-acquiring it in the rarely
used code if appropriate).
So the argument that the latency of page faults is unavoidable
regardless of the design is misleading. Good design can minimize the
harm that page faults do and bad design can magnify it.
DS
.
- Follow-Ups:
- Re: Reconciling Garbage Collection with Deterministic Finalization
- From: David Hopwood
- Re: Reconciling Garbage Collection with Deterministic Finalization
- Prev by Date: Re: Lock-free not useful? (was Re: Reconciling Garbage Collection with Deterministic Finalization)
- Next by Date: thread safe dynamic array and/or matrix
- Previous by thread: Re: Garbage Collection...
- Next by thread: Re: Reconciling Garbage Collection with Deterministic Finalization
- Index(es):
Relevant Pages
|