gnustep-dev
[Top][All Lists]
Advanced

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

Re: A question on discardEventsMatchingMask:beforeEvent:


From: SPUeNTRUP - Kai Henningsen
Subject: Re: A question on discardEventsMatchingMask:beforeEvent:
Date: Mon, 31 Jan 2011 16:16:37 +0100

Hallo Herr Chisnall,
Hallo Frau Chisnall,
Hallo David,

Am Mon, 31 Jan 2011 09:59:10 +0000
schrieb David Chisnall <address@hidden>:

> On 31 Jan 2011, at 09:51, SPUeNTRUP - Kai Henningsen wrote:
> 
> >> When I was looking at it, I found it hard to see how best to make a fast 
> >> allocation/deallocation scheme thread-safe.
> > 
> > I learned this from ptmalloc3
> 
> 
> ptmalloc() is very heavily optimised for the case in which malloc() and 
> free() are both called in the same thread.  For NSEvent, this may well not be 
> the case, as the event is delivered to a run loop, which may pass it off to 
> another thread.

Actually, I used it in a context where free() on a different thread
from malloc() was the rule, not the exception, and it was fine.

The other performance problem I had was the central object lock in
libobjc - changing that to a per-object lock also helped performance a
lot, in a program with many threads. Each of these changes resulted in
drastic performance improvements, in both cases by reducing lock
contention by a large factor. (I had yet another case with a lock of my
own.) The application was nearly unrecognizable afterwards, it was so
much faster.

Mit freundlichen Grüßen aus Münster /
with kind regards - Kai Henningsen

-- 
SPUeNTRUP Software
An der Kleimannbrücke 52
D-48157 Münster, Germany

Reg:    Münster Nr.29047

Fon:    +49 700 CALL CATS (=22552287)
Fon:    +49 251 322 311 0
Fax:    +49 251 322 311 99

Web:    http://www.cats.ms
Mail:   address@hidden



reply via email to

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