home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / Examples / ThreadedApp-1.0.1 / ThreadedApp.README < prev    next >
Encoding:
Text File  |  1997-04-02  |  1.9 KB  |  45 lines

  1. ThreadedApp v 1.0
  2.  
  3. Chris Roehrig <croehrig@House.ORG>
  4. March 1997
  5.  
  6.  
  7. Writing multi-threaded applications in NEXTSTEP is not as easy as it could
  8. be.  I wrote ThreadedApp to make it easy to write multi-threaded
  9. applications that use the AppKit.   In particular, it provides an easy
  10. mechanism for threads to use the AppKit features in a safe and robust way.
  11.  
  12. So now there's no excuse not to use threads!   Let's make those Apps
  13. RESPONSIVE!
  14.  
  15.  
  16. ThreadedApp
  17. Support for multi-threaded applications for NEXTSTEP 3.3.
  18.  
  19. ThreadedApp is a subclass of Application that contains the functionality of 
  20. the OpenStep NSThread object, but also provides increased support for 
  21. interaction with the AppKit. The AppKit is not thread-safe and only the 
  22. main thread can use it.  All other threads must message the main thread 
  23. to perform any functions (drawing, etc) that involve the AppKit.   
  24. ThreadedApp does this by introducing the notion of callback methods.   
  25. This is a flexible mechanism whereby a thread can request that the main 
  26. application thread invoke a method on its behalf.     This allows a thread 
  27. to have virtually full access to the AppKit in a way that is easy to 
  28. understand and use.
  29.  
  30. The callback mechanism uses Mach messages to make requests to the main
  31. AppKit thread.   The main thread only receives the messages when it is in
  32. an event loop, so it is crucial that the main thread remains responsive to
  33. events. (This is only good user-interface design anyways.)
  34.  
  35. ThreadedApp provides support for locking shared data or code via the
  36. CJRLock and CJRConditionLock classes.   These classes allow the main AppKit
  37. thread to "block" while waiting to acquire a lock, but still remain
  38. responsive to events so that other threads may still perform callbacks.
  39.  
  40. Send any bug reports, comments, etc. to Chris Roehrig <croehrig@House.ORG>
  41. If you find ThreadedApp useful and are using it in an application, send me 
  42. a note; I'd like to hear about it!
  43.  
  44.     Chris
  45.