Welcome, Guest. Please login or register.
Amiga Kit Amiga Store Hollywood MAL AMIStore App Store A600 Memory

AuthorTopic: Messages between Tasks, Exec question  (Read 1349 times)

0 Members and 1 Guest are viewing this topic.

Offline jahc

Messages between Tasks, Exec question
« 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..

 

  • Guest
Re: Messages between Tasks, Exec question
« Reply #1 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.
 

Offline CodeSmith

Re: Messages between Tasks, Exec question
« Reply #2 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.
 

Offline Thomas

Re: Messages between Tasks, Exec question
« Reply #3 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

Offline xeron

Re: Messages between Tasks, Exec question
« Reply #4 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.
Playstation Network ID: xeron6
 

Offline jahc

Re: Messages between Tasks, Exec question
« Reply #5 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.