New software written for a new OS, such as a New AROS or new MorphOS can use semaphores to access the various protected OS structures.
I don't think this should even be considered unless as an absolute last resort. Making that compromise without knowing what the benefits are would be a mistake.
@Itix: why do we need to halt multitask by using enable/disable ?
Blame Carl Sassenrath.
How do OS that support real SMP work ? I mean: what's the main difference with AmigaOS and "modern" OS ?
AmigaOS has a lot of design mistakes in, which didn't matter so much on a games console from the early 1980's that would be around for a few years.
Worrying about not being able to use every ounce of cpu power when using SMP is a mistake. Windows/Linux has a high latency on a lot of it's api calls.
Getting accurate results can be difficult but itcould be profiled. At least how many calls to Forbid() or Disable() there are per minute...
The number of calls is not the metric you need. It's how long it spends in Forbid(). You could make one call and stay in Forbid() for 99% of time, or 10 calls and only stay in Forbid() for 1% of time. This affects how much of each CPU you'll lose. The overhead of stopping and starting each cpu would also need to be taken into account, however this becomes even more of a problem to calculate because unless you've written the code and tested it you don't even know what the overhead will be. Plus just counting instructions doesn't help as modern CPU's are way too complex.
[/QUOTE]
sillypseudocode()
{
SetTaskPri(SysBase->ThisTask, -128);
PutMsg(port, msg);
while (true)
PutMsg(GetMsg(port));
}
I can play too.
sillypseudocode()
{
Forbid();
while (true);
}
Sure there are pathological cases, The easiest way to speed up your program is for the user to not run it.
Anyway, I just wanted to point out that biggest culprit is the OS itself and write some silly example
But you don't have any idea what the overhead of the biggest culprit is. It depends on how many messages are being processed, what work is done on each message.
The whole point of coding it was to avoid the constant arguments based on contrived examples & be able to see how real software that people might want to run will behave. It doesn't matter if it's not perfect, it's research. It could be derailed by something that nobody has considered.