Re: How to make DO not do transformations
Re: How to make DO not do transformations
- Subject: Re: How to make DO not do transformations
- From: Robert Goldsmith <email@hidden>
- Date: Tue, 24 Sep 2002 22:13:17 +0100
>
I'm actually wanting to hand-off responsibility of the object from one
>
thread to another. The object in this case is a network response
>
message (not using DO for networking).
Ok, so a data block arrives at thread one and needs to be dealt with by
thread 2. The best bet is prob. shared memory. Not sure how you would
go about it in a cocoa app but it always used to be the fastest way to
do things :) In essence, you have a block of memory where thread 1
dumps stuff, then it informs thread 2 there is something interesting
for it and thread 2 can read the contents of the same buffer. However,
it was still always the case that you wanted to shift the data out of
the shared space asap (copy) so that it was freed up for another
transfer (complex queue systems etc. help here but the basics are still
true).
I am surprised by the 30 messages per second. May I suggest you don't
use objc instances for the message packets? Structs or simply an array
of chars might be faster because they are simply copied over using DO.
Even better, a good old malloc memory block. C is generally faster than
objc so when speed is needed, best to fall back on the C approach.
Robert
---
GnuPG public key:
http://www.Far-Blue.co.uk/RSGoldsmith.asc
[demime 0.98b removed an attachment of type application/pgp-signature which had a name of PGP.sig]
_______________________________________________
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.