• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Accessing NSTextView from a thread (locking problem)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Accessing NSTextView from a thread (locking problem)


  • Subject: Accessing NSTextView from a thread (locking problem)
  • From: Allan Odgaard <email@hidden>
  • Date: Sat, 6 Jul 2002 13:04:35 +0200

Hi there,

I have sub-threads which create output in their own NSTextViews -- this gadget is handled entirely by the sub-thread, though when calling setNeedsDisplay then the NSTextView will be redrawn by the main thread (AFAIK).

For this reason I have added an NSLock to the NSTextView which I obtain in the sub-thread (when adding text) and also in the drawRect selector (which I've overloaded).

Unfortunately my program still has a tendency to freeze, and it seems to always be while the sub-thread is adding to the NSTextView.

My next step will probably be to try and make the main thread handle all the NSTextViews and then have the sub threads send data to the main thread -- though I would like to know what could be the reason for my problems?!?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
  • Follow-Ups:
    • Re: Accessing NSTextView from a thread (locking problem)
      • From: Cryx <email@hidden>
  • Prev by Date: NSOutlineView: width of column excl. the indentation?
  • Next by Date: Re: NSOpenGLPixelFormatAttribute in ObjC++
  • Previous by thread: NSOutlineView: width of column excl. the indentation?
  • Next by thread: Re: Accessing NSTextView from a thread (locking problem)
  • Index(es):
    • Date
    • Thread