Re: threads, notifications and DOs
Re: threads, notifications and DOs
- Subject: Re: threads, notifications and DOs
- From: Robert Cerny <email@hidden>
- Date: Wed, 18 Sep 2002 11:15:31 +0200
Hi,
the first great thing I found in Cocoa were notifications. But while I
started developing multithreaded applications, I went into big problems
with them. Somebody on this list said:"Never use notifications for
inter-application or inter-thread communication" and he was right. I
would recommend DO (in which I'm still real novice) and as a must-read
article I would recommend the source for Trivial Threads. Especially
the (oneway void) declaration for speeding things up...
Robert
On Tuesday, Sep 17, 2002, at 16:46 Europe/Prague, Robert Goldsmith
wrote:
Hi all :)
I was wondering what experiences people here have had concerning
threads, notifications and DOs (as the subject says <g>).
Basically, I am trying to weigh up the advantages and disadvantages of
methods to passing data between threads and possibly processes and was
interested in overhead, lag and max data sizes for different methods.
I am putting together a system that will receive data from usb, break
it up and ship it off to a number of routines that each work on
different packets (coming from a collection of robots actually). Each
routine controls one robot. Data then needs to come back from these
routines and be passed down usb off to the robot wireless network. At
the same time, logging information (such as what each robot has sensed
and what commands the routines gave) has to be collected and dealt with
in numerous ways (such as statistical stuff and basic storing to a
file). I want to be able to bring up different displays showing
visually what the robots are doing, what they have done, etc.
The usb data arrives every 10ms and is in the order of 10-20 bytes
long. The logging data will be of a similar length. The most important
job is to have a fast turn-around on processing the robot data and
sending back new control data.
the visualization and logging routines will need access to all the
robots data but each controller only needs to know about it's robot.
My first thought is to use notifications to deliver the logging info to
the different visualization routines and having each of these as a
thread (or another process maybe). I am also considering threads for
each of the robot controllers using DO for easy two-way comms with the
main routine which would do all the usb stuff and the notifications (as
well as some house-keeping). However, this relies a lot on threads and
inter-thread and inter-process comms which could just slow everything
down - even if it does make it easier to code in some ways and leaves
open the possibility of distribution over multiple cpus.
All thoughts and comments welcome
Robert Goldsmith
---
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.
_______________________________________________
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.