Subject Re: [IB-Architect] IB and SMP
Author Jim Starkey
At 03:50 PM 4/24/00 -0400, Leyne, Sean wrote:
>I'm not sure if this has been asked before or if this is the right
>forum/group to post this in but...
>
>Could someone please outline the issues related to getting IB to support
>SMP 'properly' along with a "gut" judgement on the complexity involved
>for each issue.
>

This is exactly the right forum for this type of question.

Multi-threading was introduced in the late 1980s to allow the
multi-client server to switch client context during execution
of a long request. At the time, Apollo had just introduced
multi-threading in Domain, I implemented a VMS threading
paackge, and Sun had announced multi-threading, but their
examples didn't compile. At the time multi-processors didn't
exist in the Unix world (symmetric or any other kind) and
VMS had only fledging ASMP support for the 782, aka Atlas.

The most expedient way to implement multi-threading was to
build in a mechanism where only one thread at a time could
access shared data structures -- essentially a single mutex
on the entire engine, but implemented with THREAD_ENTER and
THREAD_EXIT macros to enter and leave engine level thread
scheduling. A thread would do a THREAD_EXIT when it was
about to stall or play somewhere other than the core data
structures, then do THREAD_EXIT when it got serious. The
mechanism worked just fine on uniprocessors, but doesn't
allow significant parallel processing on SMP machines.

The solution, obviously, is to protect various data structures
with independent locks (allowing multiple readers). The
process is delicate because of potential deadlocks. Complicating
the picture is the need (?!) to support conditional compilation
for classic -- any significant change has to work in both
environments.


Jim Starkey