bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Recent drawing optimizations


From: David Ayers
Subject: Re: Recent drawing optimizations
Date: Tue, 01 Apr 2003 16:00:38 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312

Hi,

I haven't been following closely, but...

Alexander Malmberg wrote:

+/**
+ * As an exception to the general rules for threads and rendering, this
+ * method is thread-safe and may be called from any thread.
+ */
- (void) setNeedsDisplay: (BOOL)flag
{
+  if ([NSThread currentThread] != GSAppKitThread)

Calling this class method here feels *very* expensive. Wasn't there an equivalent function call that might be faster? (GSCurrentThread() I believe.)

+    {
+      [self performSelectorOnMainThread: @selector(_setNeedsDisplay_helper:)
+       withObject: [NSNumber numberWithBool: flag]
+       waitUntilDone: NO];
Where is this method declared/defined? (If it was part of a previos patch, then please forgive me.) Unless this is Cocoa method, I'd suggest renaming it to performSelectorIn(Gui/AppKit)Thread:...

And I wonder what it would mean if multiple threads call this method with diffrenent values as the parameter...

The whole notion of mutiple threads explicitly or implicitly interafaceing with the gui seems rather dangerous to me, but I guess that shouldn't concern -gui.

Cheers,
Dave







reply via email to

[Prev in Thread] Current Thread [Next in Thread]