Hi everyone,

I've finally got around to doing the optimisation on EtoileThread  
that I've been planning for a while.  ETThreadedObject now uses a  
lockless ring buffer when there are invocations in the queue (which  
is more efficient than the NSMutableArray previously used), and  
doesn't use any of the (expensive) POSIX threading locking operations  
when there are objects in the queue (until the buffer is full, and  
then it uses a spinlock in the calling thread to wait for the buffer  
to empty).  When the buffer is empty, it switches back to using  
locking and waits on a condition variable, reducing polling overhead.

When there are not many messages being sent from one thread to  
another, the overhead is the same as it was (actually, slightly  
lower, since a static array is being used, rather than an  
NSMutableArray).

When there are a lot of messages, we are now just doing a small  
amount of pointer arithmetic, rather than issuing six system calls,  
which should improve performance considerably.

This is new code, and hasn't been heavily tested, so I'd appreciate  
any bug reports (or fixes).

David

_______________________________________________
Etoile-dev mailing list
[email protected]
https://mail.gna.org/listinfo/etoile-dev

Reply via email to