README 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. This is a source code distribution for QuickThreads. QuickThreads is a
  2. toolkit for building threads packages; it is described in detail in the
  3. University of Washington CS&E Technical report #93-05-06, available via
  4. anonymous ftp from `ftp.cs.washington.edu' (128.95.1.4, as of Oct. '94)
  5. in `tr/1993/05/UW-CSE-93-05-06.PS.Z'.
  6. This distribution shows basic ideas in QuickThreads and elaborates with
  7. example implementations for a gaggle of machines. As of October those
  8. machines included:
  9. 80386 faimly
  10. 88000 faimily
  11. DEC AXP (Alpha) family
  12. HP-PA family
  13. KSR
  14. MIPS family
  15. SPARC V8 family
  16. VAX family
  17. Configuration, build, and installation are described in INSTALL.
  18. Be aware: that there is no varargs code for the KSR.
  19. The HP-PA port was designed to work with both HP workstations
  20. and Convex SPP computers. It was generously provided by Uwe Reder
  21. <uereder@cip.informatik.uni-erlangen.de>. It is part of the ELiTE
  22. (Erlangen Lightweight Thread Environment) project directed by
  23. Frank Bellosa <bellosa@informatik.uni-erlangen.de> at the Operating
  24. Systems Department of the University of Erlangen (Germany).
  25. Other contributors include: Weihaw Chuang, Richard O'Keefe,
  26. Laurent Perron, John Polstra, Shinji Suzuki, Assar Westerlund,
  27. thanks also to Peter Buhr and Dirk Grunwald.
  28. Here is a brief summary:
  29. QuickThreads is a toolkit for building threads packages. It is my hope
  30. that you'll find it easier to use QuickThreads normally than to take it
  31. and modify the raw cswap code to fit your application. The idea behind
  32. QuickThreads is that it should make it easy for you to write & retarget
  33. threads packages. If you want the routine `t_create' to create threads
  34. and `t_block' to suspend threads, you write them using the QuickThreads
  35. `primitive' operations `QT_SP', `QT_INIT', and `QT_BLOCK', that perform
  36. machine-dependent initialization and blocking, plus code you supply for
  37. performing the portable operatons. For example, you might write:
  38. t_create (func, arg)
  39. {
  40. stk = malloc (STKSIZE);
  41. stackbase = QT_SP (stk, STKSIZE);
  42. sp = QT_INIT (stakcbase, func, arg);
  43. qput (runq, sp);
  44. }
  45. Threads block by doing something like:
  46. t_block()
  47. {
  48. sp_next = qget (runq);
  49. QT_BLOCK (helper, runq, sp_next);
  50. // wake up again here
  51. }
  52. // called by QT_BLOCK after the old thread has blocked,
  53. // puts the old thread on the queue `onq'.
  54. helper (sp_old, onq)
  55. {
  56. qput (onq, sp_old);
  57. }
  58. (Of course) it's actually a bit more complex than that, but the general
  59. idea is that you write portable code to allocate stacks and enqueue and
  60. dequeue threads. Than, to get your threads package up and running on a
  61. different machine, you just reconfigure QuickThreads and recompile, and
  62. that's it.
  63. The QuickThreads `distribution' includes a sample threads package (look
  64. at stp.{c,h}) that is written in terms of QuickThreads operations. The
  65. TR mentioned above explains the simple threads package in detail.
  66. If you do use QuickThreads, I'd like to hear both about what worked for
  67. you and what didn't work, problems you had, insights gleaned, etc.
  68. Let me know what you think.
  69. David Keppel <pardo@cs.washington.edu>