ThreadedApp v 1.1

Chris Roehrig <croehrig@House.ORG>
March 1997

This is the first MiscKit release: ThreadedApp is now included with 
MiscKit v ????   The latest MiscKit will always contain the most up-to-date 
version of ThreadedApp, so it is suggested you use the MiscKit version 
if possible.

------------

Writing multi-threaded applications in NEXTSTEP is not as easy as it could
be.  I wrote MiscThreadedApp to make it easy to write multi-threaded
applications that use the AppKit.   In particular, it provides an easy
mechanism for threads to use the AppKit features in a safe and robust way.

All source code in this module can be freely distributed and modified
providing the copyright notice remains intact.

So now there's no excuse not to use threads!   Let's make those Apps
RESPONSIVE!


MiscThreadedApp
Support for multi-threaded applications for NEXTSTEP 3.3.

MiscThreadedApp is a subclass of Application that contains the functionality 
of the OpenStep NSThread object, but also provides increased support for 
interaction with the AppKit. The AppKit is not thread-safe and only the 
main thread can use it.  All other threads must message the main thread 
to perform any functions (drawing, etc) that involve the AppKit.   
ThreadedApp does this by introducing the notion of callback methods.   
This is a flexible mechanism whereby a thread can request that the main 
application thread invoke a method on its behalf.     This allows a thread 
to have virtually full access to the AppKit in a way that is easy to 
understand and use.

The callback mechanism uses Mach messages to make requests to the main
AppKit thread.   The main thread only receives the messages when it is in
an event loop, so it is crucial that the main thread remains responsive to
events. (This is only good user-interface design anyways.)

MiscThreadedApp provides support for locking shared data or code via the
MiscLock and MiscConditionLock classes.   These classes allow the main AppKit
thread to "block" while waiting to acquire a lock, but still remain
responsive to events so that other threads may still perform callbacks.

Send any bug reports, comments, etc. to Chris Roehrig <croehrig@House.ORG>
If you find MiscThreadedApp useful and are using it in an application, send me 
a note; I'd like to hear about it!

    Chris
