Click Here
home features news forums classifieds faqs links search
6071 members 
Amiga Q&A /  Free for All /  Emulation /  Gaming / (Latest Posts)
Login

Nickname

Password

Lost Password?

Don't have an account yet?
Register now!

Support Amigaworld.net
Your support is needed and is appreciated as Amigaworld.net is primarily dependent upon the support of its users.
Donate

Menu
Main sections
» Home
» Features
» News
» Forums
» Classifieds
» Links
» Downloads
Extras
» OS4 Zone
» IRC Network
» AmigaWorld Radio
» Newsfeed
» Top Members
» Amiga Dealers
Information
» About Us
» FAQs
» Advertise
» Polls
» Terms of Service
» Search

IRC Channel
Server: irc.amigaworld.net
Ports: 1024,5555, 6665-6669
SSL port: 6697
Channel: #Amigaworld
Channel Policy and Guidelines

Who's Online
10 crawler(s) on-line.
 86 guest(s) on-line.
 0 member(s) on-line.



You are an anonymous user.
Register Now!
 michalsc:  9 mins ago
 Rob:  11 mins ago
 pixie:  18 mins ago
 roar:  1 hr 17 mins ago
 MEGA_RJ_MICAL:  1 hr 24 mins ago
 VooDoo:  1 hr 32 mins ago
 Hammer:  2 hrs 3 mins ago
 Massi:  2 hrs 8 mins ago
 DiscreetFX:  2 hrs 27 mins ago
 agami:  3 hrs 38 mins ago

/  Forum Index
   /  AROS Software
      /  ARPi - AROS on Raspberry Pi
Register To Post

PosterThread
michalsc 
Re: ARPi - AROS on Raspberry Pi
Posted on 29-Aug-2018 18:25:32
#1 ]
AROS Core Developer
Joined: 14-Jun-2005
Posts: 377
From: Germany

@matthey

Quote:
I wonder what the logic was behind the Forbid/Permit macros. I would have thought they would have used a function to increment the Execbase counters and, if 0 or becoming not 0, write an interrupt mask value to one of the Paula registers to actually turn off/on whatever interrupts were necessary to disable multitasking (or all interrupts).


No, you have mixed it. Forbid increases TDNestCnt byte value. If it is zero or greater than zero, then no new task will be rescheduled (preemption disabled). All interrupts remain enabled and may process. But if a reschedule would be requested (by interrupt for example, by means of sending a signal to task/process), it will be not "activated", only delayed reschedule request flag in SysBase will be set.

If, however, the task gives its CPU time by itself, e.g. by calling any function that waits (for signal, message, whatever), it will be rescheduled (call it cooperative part of multitasking). Once the task gets CPU time again, the systems TDNestCnt will be set again to the previous value.

When Permit() is called, TDnestCnt is decreased. If it turns from 0 to -1, scheduler will be eventually called (if it was actually requested) and task switch can occur.

Now what you described was Disable()/Enable() pair. During Disable call all interrupts are unconditionally disabled and IDNestCnt byte is increased. During Enable() call IDNestCnt is decreased and if it turns from 0 to -1, interrupts will be re-enabled.

So, to summarise, Forbid()/Permit() disables scheduler only, guaranteeing that the task will run uninterrupted by other tasks. Usable when e.g. several tasks want to access one shared resource of any kind. Disable()/Enable() effectively disables interrupts (and thus the scheduler too, since it is driven by vertical blank interrupt) guaranteeing exclusive access to resource which could be otherwise accessed both by task and/or interrupt handlers.

 Status: Offline
Profile     Report this post  
 Top | Parent

Replies
SubjectPosterDate
      Re: ARPi - AROS on Raspberry Pimatthey30-Aug-2018 5:25:14
          Re: ARPi - AROS on Raspberry Pimegol30-Aug-2018 13:14:19
              Re: ARPi - AROS on Raspberry Pinikosidis30-Aug-2018 16:11:23
              Re: ARPi - AROS on Raspberry Pimatthey30-Aug-2018 19:25:40
                  Re: ARPi - AROS on Raspberry PiWumpus30-Aug-2018 20:13:04
                      Re: ARPi - AROS on Raspberry Pimichalsc5-Sep-2018 9:41:20
                          Re: ARPi - AROS on Raspberry PiWumpus5-Sep-2018 16:17:59
                              Re: ARPi - AROS on Raspberry Pinikosidis5-Sep-2018 16:22:31
                              Re: ARPi - AROS on Raspberry Pimichalsc5-Sep-2018 17:06:12
                                  Re: ARPi - AROS on Raspberry PiWumpus5-Sep-2018 20:42:56
                                      Re: ARPi - AROS on Raspberry Pimichalsc5-Sep-2018 20:54:43
                                          Re: ARPi - AROS on Raspberry Pihth3136-Sep-2018 7:10:13
                                              Re: ARPi - AROS on Raspberry Pimichalsc6-Sep-2018 7:47:05
                                          Re: ARPi - AROS on Raspberry PiOlafS256-Sep-2018 10:32:59
                                              Re: ARPi - AROS on Raspberry Piwawa6-Sep-2018 17:52:44
                                                  Re: ARPi - AROS on Raspberry Piterminills18-Sep-2018 12:55:02
                                                      Re: ARPi - AROS on Raspberry Piwawa18-Sep-2018 14:25:11
                                                          Re: ARPi - AROS on Raspberry Pinikosidis18-Sep-2018 15:21:21
                                                      Re: ARPi - AROS on Raspberry Piterminills19-Oct-2018 12:56:49
                                                          Re: ARPi - AROS on Raspberry Pinumber619-Oct-2018 14:50:03
                                                              Re: ARPi - AROS on Raspberry Piwawa19-Oct-2018 16:58:30
                                                          Re: ARPi - AROS on Raspberry PiOlafS2519-Oct-2018 17:00:10
                                                          Re: ARPi - AROS on Raspberry Piterminills9-Nov-2018 11:00:45
                          Re: ARPi - AROS on Raspberry Pimatthey5-Sep-2018 20:22:59
                              Re: ARPi - AROS on Raspberry Pimichalsc5-Sep-2018 20:38:30
                                  Re: ARPi - AROS on Raspberry Pibison5-Sep-2018 21:03:09
                                  Re: ARPi - AROS on Raspberry Pimatthey5-Sep-2018 21:28:52
                                      Re: ARPi - AROS on Raspberry Pimichalsc5-Sep-2018 21:40:24



[ home ][ about us ][ privacy ] [ forums ][ classifieds ] [ links ][ news archive ] [ link to us ][ user account ]
Copyright (C) 2000 - 2019 Amigaworld.net.
Amigaworld.net was originally founded by David Doyle