Re: Best way to push action from 1 thread to another?
Re: Best way to push action from 1 thread to another?
- Subject: Re: Best way to push action from 1 thread to another?
- From: Cryx <email@hidden>
- Date: Wed, 8 May 2002 23:44:09 -0500
Try using true notifications sent via a notification center. The
receiver is hooked nicely into your event loop, ala what you are doing
now. It's probably more efficient, but it's at a minimum far fewer
lines of code and more maintainable.
On Wednesday, May 8, 2002, at 02:27 PM, Dave Fayram wrote:
Hi,
Well I ended up using notifications in my network monitor. So now
I've got another "efficiency" question. I'm
currently using a thread to loop on a pcap socket, which then pushes
the data pcap returns through an NSPort
to get it back into the thread that the AppKit NSRunLoop resides on.
This works, but I'm curious if this is the
Best Way(tm) to go about pushing data from one thread to the next. I'm
almost inclined to write a more efficient
pthreads solution personally. There is a lot of overhead with using the
mach port to do it (and not just in using
the port, also in stuff like archiving the desired objects as data to
send via the port).
So probably the best thing I can ask as a followup is, is there a
way to send notifications such that
they occur in a different thread? Maybe some magical thing I'm
overlooking? It would seem to me a lot
of developers would want this, since AppKit isn't thread safe...
- Dave "Paradox" Fayram
My ElGamal and DSA keys can be found at:
http://zero.atomictrain.net:88/~paradox/pgpkey.html
"Not everyone finds Drag'n'Drop as intuitive as they should."
_______________________________________________
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.
_______________________________________________
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.