home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_09_01 / 9n01060a < prev    next >
Text File  |  1990-11-15  |  622b  |  33 lines

  1.  
  2.  
  3.  
  4. /* ************************************************ */
  5. /* Demonstration of technique for multi-threading C */
  6.  
  7. #define  NULL 0
  8. main()
  9. {
  10.   extern case0(), case1(), case2() ;
  11.   thread( case0, case1, case2, NULL) ;
  12. }
  13. int case0()
  14. {
  15.     printf("** First thread part 1 **  ) ;
  16.     threadswitch() ;
  17.     printf("** First thread part 2 **  ) ;
  18. }
  19. int case1()
  20. {
  21.     printf("** Second thread part 1 **  ) ;
  22.     threadswitch() ;
  23.     printf("** Second thread part 2 **  ) ;
  24. }
  25. int case2()
  26. {
  27.     printf("** Third thread part 1 **  ) ;
  28.     threadswitch() ;
  29.     printf("** Third thread part 2 **  ) ;
  30. }
  31.  
  32.  
  33.