Welcome, Guest. Please login or register.

Author Topic: Exec exception handling and a time interval implementation...  (Read 5446 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show all replies
I have almost finishing implementing in my program something more or less general that allows any kind thing (code or data) to change through time according to user specified intervals and intervalsets (sets of subsequent intervals). As allways, rather than going for the easy way I want to tweak it and make the design the more efficient possible:) Currently I'm undecided between the following 3 ways and have one important doubt in 1:
1- Having the timer.device send messages when the beggining of next interval is reached to the process that handles the object, the messages being handled by an Exec exception. This is my favourite but I'm having a problem with it: I've read that Exec disables signals while processing exceptions, so what will happend if another signal is received (e.g. signaling the end of another objects current interval) while the exception is being processed, will exec process it after ?
2- Same as above but through a software interrupt, although here all other processes will be interrupted to process it so probably not as good.
3- Screw it, it's not that much big overhead in general except when time intervals are very short so check to see if current interval time has already passed each time the corresponding object is used, while in previous implementations it would only need to copy a pointer to the object before starting to use it. Not so efficient of course, cause it's done each time the object is used but less implementation headaches.

What do you guys think ?
:pint:
\\"We made Amiga, they {bleep}ed it up\\"
 

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show all replies
Re: Exec exception handling and a time interval implementation...
« Reply #1 on: May 27, 2006, 06:25:02 PM »
@itix

The RKM's say timer.device is safe to use.

@Piru

"This is my favorite."
Why ?:-) If intervals get very short the other tasks running will come to an halt, or not ? Using 1 the time precision would be limited by the speed of the system and other running tasks but processor time would be evenly distributed among them according to their priority.

"You could also use the undocumented msgport feature:
Setting mp_Flags to 3 will".

The RKM Libs (what I've read) talks about it. It's the PA_SOFTINT flag.
\\"We made Amiga, they {bleep}ed it up\\"
 

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show all replies
Re: Exec exception handling and a time interval implementation...
« Reply #2 on: May 29, 2006, 07:58:39 PM »
Sounds cool. So that means using mp_Flags set to 3 the called routine in mp_SigTask won't use the system stack and supervisor mode right ? Wich means it will be faster. But in this case won't the context be the timer.device's (that's sending a ReplyMsg() to my timerequests) ? Is that even a good thing (using timer.device's context) ?
\\"We made Amiga, they {bleep}ed it up\\"
 

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show all replies
Re: Exec exception handling and a time interval implementation...
« Reply #3 on: June 01, 2006, 07:23:08 PM »
One more question 8-)
Is the Disable state entered right away when message is sent or replied (like in an interrupt)or only after that Exec's round robin thing reaches the corresponding task ?
\\"We made Amiga, they {bleep}ed it up\\"