• 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
Re: Issues with multithreaded drawing in Cocoa?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Issues with multithreaded drawing in Cocoa?


  • Subject: Re: Issues with multithreaded drawing in Cocoa?
  • From: email@hidden
  • Date: Wed, 10 Dec 2003 09:28:01 -0500

Hm, yes, but that's not really what I'm doing. Let me rephrase:

All my second thread is doing is calling setNeedsDisplayInRect: on the
view, then the view is redrawn in the usual way (by the main thread).

I based my assumption that this would work on:

If a secondary thread of an application wants to cause portions of the
view to be redrawn on the main thread, the normal mechanisms work:
setNeedsDisplay:,setNeedsDisplayInRect:, and setViewsNeedDisplay:.

...which I got from
http://developer.apple.com/documentation/Cocoa/Conceptual/
Multithreading/Tasks/appkit.html

This is exactly what I'm doing, and it's not always working.

Thoughts?

J.D.

On Dec 10, 2003, at 9:01 AM, Frederick Bartram wrote:

> Zamfi...
>
> This url:
> <http://developer.apple.com/documentation/Cocoa/Conceptual/
> Multithreading/Concepts/safety.html> discusses thread safety while
> drawing.
>
> The relevant line appears to be:
>>  If a thread is going to draw in a view, bracket all drawing code
>> between the NSView methods lockFocusIfCanDraw andunlockFocus.
>
> Hope this helps.
>
> ...rick bartram
> /*---------------------------------------------------------------
> * Stop spam before it gets to your mailbox! Support blocklists.
> * I use Spamcop.net.
> */
_______________________________________________
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.

  • Prev by Date: Re: root user cannot compile NSAppleScript
  • Next by Date: How Do I kill a process from Cocoa?
  • Previous by thread: Is there a Java version of SGDataProc?
  • Next by thread: re: Issues with multithreaded drawing in Cocoa?
  • Index(es):
    • Date
    • Thread