[comp.sys.next] threads in Objective-C

dennisg@kgw2.UUCP (Dennis Glatting) (12/06/89)

does anyone know the restrictions or implications of using threads
in a Objective-C app?  i use multiple threads in my C apps on the NeXT.
is multi-threaded O-C apps recommended?

--
 dennisg%kgw2%tron.UUCP@umbc3.UMBC.EDU  | Dennis P. Glatting
   I want my own NeXT, 64 MB RAM, 660 MB SCSI, NeXT Printer.
   ** Accepting Donations **

ali@polya.Stanford.EDU (Ali T. Ozer) (12/08/89)

In article <299@kgw2.UUCP> dennisg@kgw2.UUCP (Dennis Glatting) writes:
>does anyone know the restrictions or implications of using threads
>in a Objective-C app?  i use multiple threads in my C apps on the NeXT.
>is multi-threaded O-C apps recommended?

Multiple-threads should work fine, as long as you watch out for the
standard sort of problems.  However, trying to access the dps connection
through multiple threads is likely to cause trouble; don't try to do drawing
or event handling at the same time from separate threads in one app.

Ali

eht@f.word.cs.cmu.edu (Eric Thayer) (12/09/89)

In article <299@kgw2.UUCP> dennisg@kgw2.UUCP (Dennis Glatting) writes:
>does anyone know the restrictions or implications of using threads
>in a Objective-C app?  i use multiple threads in my C apps on the NeXT.
>is multi-threaded O-C apps recommended?
>

You should not have more than one thread causing updates to the display.
We had difficulties with this in our demo software.  One thread was
updating one field and during that update, another thread caused another
field to be updated.  This totally confused the state of the display code.
We used a mutex to serialize access to the display code and things have worked
ok after that.
-- 
Eric H. Thayer      School of Computer Science, Carnegie Mellon
(412) 268-7679      5000 Forbes Ave, Pittsburgh, PA 15213