Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!sdd.hp.com!zaphod.mps.ohio-state.edu!rpi!batcomputer!cornell!rochester!pt.cs.cmu.edu!o.gp.cs.cmu.edu!netnews From: eht@cs.cmu.edu (Eric Thayer) Newsgroups: comp.sys.next Subject: Re: Cthreads on NeXT Message-ID: <1991Mar28.150137.28145@cs.cmu.edu> Date: 28 Mar 91 15:01:37 GMT References: <50814@apple.Apple.COM> Sender: netnews@cs.cmu.edu (USENET News Group Software) Organization: School of Computer Science, Carnegie Mellon Lines: 19 In article <50814@apple.Apple.COM> mikel@Apple.COM (Mikel Evins) writes: > In article michael@ewa.cs.ucla.edu (michael gersten) writes: > > > >Is the Cthreads package supported on Next? > > Yes. I've used it myself. > Cthreads does work (and they are real threads), but you have to take care if multiple threads wish to change the state of *kit objects (especially the objects that have graphical representations). It is necessary to generate an event which is then processed by the Application's event loop. There are various ways to generate an event from a thread (see DPSAddPort(), DPSAddFD(), Speaker). With Speaker implementations you should be careful that multiple threads are not sharing the same speaker object (i.e. if every thread just uses [NXApp appSpeaker] you may find yourself toasted). ..eric