Amiga.org

Operating System Specific Discussions => Amiga OS => Amiga OS -- Development => Topic started by: jahc on November 05, 2002, 12:32:49 AM

Title: Messages between Tasks, Exec question
Post by: jahc on November 05, 2002, 12:32:49 AM
Hi, I'm about to make my first C++ AmigaOS program, and I need a bit of advice..

It's going to be an internet program, and I think I'm going to have a separate internet handling task, that will communicate with the rest of my program.. So that my program doesnt freeze up while waiting for (for example) connecting to a server..

Now, when I connect to the server, I'm going to receive a few thousand lines from them.. my question is, will my program bog down the computer and OS if I have a thousand messages going back and forth between my tasks? I've got a 128kbit connection, so thats about.. err.. (thinks).. about 10-20 lines of information every second? Something like that..

If that does present a problem, then I may only send the last 10 lines of info from the server in one message at a time..

Anyway what do you guys think? Ideally, I'd like my program to function well on an 020 or 030, but I am thinking of making it OS 4.0 only..

Title: Re: Messages between Tasks, Exec question
Post by: on November 05, 2002, 01:41:16 AM
You want to build something for the Amiga OS 4?
That has to do with internet?

Speedtouch usb dsl modem driver.
Title: Re: Messages between Tasks, Exec question
Post by: CodeSmith on November 05, 2002, 04:21:08 AM
Uh, he said this is his *first* Amiga C++ program.  I'd say a device driver of any kind will probably be his 500th or so...  :-)

Don't worry, if history is any guide within the first few months of OS4 being out, someone will port the Linux driver and post it on aminet.
Title: Re: Messages between Tasks, Exec question
Post by: Thomas on November 05, 2002, 10:04:53 AM
Quote

jahc wrote:
Hi, I'm about to make my first C++ AmigaOS program, and I need a bit of advice..

It's going to be an internet program, and I think I'm going to have a separate internet handling task, that will communicate with the rest of my program.. So that my program doesnt freeze up while waiting for (for example) connecting to a server..

Now, when I connect to the server, I'm going to receive a few thousand lines from them.. my question is, will my program bog down the computer and OS if I have a thousand messages going back and forth between my tasks? I've got a 128kbit connection, so thats about.. err.. (thinks).. about 10-20 lines of information every second? Something like that..

If that does present a problem, then I may only send the last 10 lines of info from the server in one message at a time..

Anyway what do you guys think? Ideally, I'd like my program to function well on an 020 or 030, but I am thinking of making it OS 4.0 only..


I cannot speak for OS4 but for OS3 and below sending a message means adding a pointer to a linked list and receiving a message means removing the pointer from the list. No memory is moved. The receiving program accesses the sending program's memory (that is the reason why it is so difficult to implement memory protection in AmigaOS). I doubt that you can slow down the OS by sending messages. Perhaps you'll have to bundle several messages into larger packets.

Bye,
Thomas
Title: Re: Messages between Tasks, Exec question
Post by: xeron on November 05, 2002, 10:11:41 AM
Quote

jahc wrote:
Now, when I connect to the server, I'm going to receive a few thousand lines from them.. my question is, will my program bog down the computer and OS if I have a thousand messages going back and forth between my tasks?


No. AmigaOS exec messaging is extremely fast because no copying of data is involved. In fact, if you have a bunch of apps running, there are probably thousands of messages being sent all the time.
Title: Re: Messages between Tasks, Exec question
Post by: jahc on November 05, 2002, 10:41:37 AM
Thanks for your replies guys!

I think I have a better idea of how to write my program now anyway, after thinking about it for awhile. :) Programming is fun.