Thinking ahead: Supporting multicore CPUs
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 ... 26
Rick Murray (539) 13806 posts |
Is this not true of any system that has a possibility of multiple tasks talking to hardware while sharing time/resources with other tasks that might want to do likewise? To give an example, it seems something of a free-for-all with regards the other high resolution timer… Perhaps the way forward is an extension of the device claim protocol to be able to flag in the HAL (and read in other tasks) whether or not something has been “claimed”? This could even be expanded fairly simply (a few LDRs and a TST) to fault an application trying to use something that it has not first claimed… [it should request the task handle (UID for non Wimp programs) to allow us to tell one app from another] |
h0bby1 (2567) 480 posts |
aaaaa |
Rick Murray (539) 13806 posts |
Define “below Wimp”? RISC OS is not Linux. It isn’t Windows either. The Wimp provides the “framework” for handling task switching and the graphical environment. Nothing else. The important thing with the suggestions that I am making is that I am thinking of ways to enhance RISC OS without messing up compatibility. This isn’t Linux where random people can bugger around with the kernel API and just “expect” everything else to lock step. The RISC OS market is small, and perhaps Aemulor is the best testament to the important things that didn’t make the transition to 32 bit (never mind later rotated loads). It is absolutely imperative that further modifications do NOT break correctly written software… |
h0bby1 (2567) 480 posts |
aaaaa |
Steve Pampling (1551) 8155 posts |
Yup, and the difference between an application being presented with full access to the system on a 200MHz clocked processor as a CMT OS application and an application being presented with apparent full access to a system via a thread running on a 2GHz PMT system such that the thread appears to be a 200MHz system is what exactly? |
h0bby1 (2567) 480 posts |
aaaaa |
h0bby1 (2567) 480 posts |
aaaaa |
h0bby1 (2567) 480 posts |
aaaaa |
h0bby1 (2567) 480 posts |
aaaaa |
David Feugey (2125) 2709 posts |
+1
+2
Yes, and? Everything related to multitasking is – in RISC OS – managed in user space by the Wimp. That’s a limit, but also a good thing (you can stop using multitasking at any time), and not so inefficient (a monotasked kernel is really light: try to run dhrystone in supervisor mode VS taskwindow).
Except from running tasks made for CMT (the 50% one that do not work with Wimp2).
What for? The kernel is monotask.
+3
+4
IMHO, SMP is a complete non sense for a ‘monotasked’ kernel. AMP + messaging + CLI access would be much more easier to implement, even if more complex to use (the same for PMT VS CMT). That’s the path Amiga users followed some time ago with great success. SMP is cool, but really too much work and problems. AMP is ‘doable’ today. A few line of codes permit to simulate several ARM systems (with their own memory space) on a multicore processor. ARM says that you can run several sessions of the OS, and if they do not access the same external resources, they will work ‘as is’, without any modification. Of course, access to all CPU resources in an AMP system is not automatic and transparent, but it’s a good way to use multicore, and a perfect path for clustering (that works exactly the same way). That’s why I did propose AMP + a set of interaction tools (remote CLI, remote FTP, remote messaging), for multicore systems, but also for mini clusters (for example some Pi configured in USB device mode or present on a network). Then it will be very easy to offlad tasks to other cores or other processors. Cluster mode (Cores, USB devices, Ethernet devices) would be a great add on to RISC OS, especially with a feature to auto-discover available resources. Of course, interaction tools should be the same in the 3 modes, but with different ways to exchange data (shared memory for cores, usb stack for device mode, ethernet stack for network mode). That’s a different subject, but more closed to the topic :) |
David Feugey (2125) 2709 posts |
And of course, all of this (AMP mode) not in the kernel, but in modules/user-space. The RISC OS advantage is that all can be unplugged. RISC OS is not here to fix rules, but to provide some services. I see it as a toolbox :) |
h0bby1 (2567) 480 posts |
aaaaa |
David Feugey (2125) 2709 posts |
So just do it. you’re welcome :) |
Steve Pampling (1551) 8155 posts |
The author had one big hurdle that isn’t present now: He did what he could in the limits existing at the time. |
h0bby1 (2567) 480 posts |
aaaaa |
h0bby1 (2567) 480 posts |
aaaaa |
Rick Murray (539) 13806 posts |
Think about the time when the Wimp was written. Windows barely existed. Linux didn’t exist. Memory was frightfully expensive, harddiscs too. It may well have been broken into sections so that it could be loaded and assembled in parts rather than clogging up a machine that would be laughably small by today’s standards trying to assemble the entire Wimp in one go. If I recall, one of the things that happened at the ROLtd camp is to reorganise the Wimp into sections related to what the code was doing (like “icon stuff” and “messaging stuff”) with appropriate names, as opposed to the current mess of numbered files with stuff scattered around. There are rough “themes” to each file, but there are plenty of exceptions, and with no sensible form of function indexing, it is harder than it ought to be to find functions. I have here a personal copy of the Wimp where I have started to do this, but it’s about a dozen versions out of date. ;-) |
h0bby1 (2567) 480 posts |
aaaaa |
h0bby1 (2567) 480 posts |
aaaaa |
h0bby1 (2567) 480 posts |
aaaaa |
h0bby1 (2567) 480 posts |
aaaaa |
Rick Murray (539) 13806 posts |
Could be “doable”. Dupe the file loading stuff into an array and have it select what you wish to look at. It might be worth considering making a “cache file” to save parsing the source every time it is loaded – you can check the file is “the same” (same date and size?) and if so, load a predigested version instead? Just an idea…
It already detects labels in the file you’re looking at. Could do with being refined, but it’s a start. Note the terms of the licence: You may do what you like with this software provided that you do not remove my credit nor supply this software with a more restrictive licence. If you use this software, or any part of it, to make money, then share… and finally if you fix bugs or extend this software, you must report these changes back to me on the understanding that I may include these changes in the main release of this software; you will be mentioned… If you distribute an executable, you must state somewhere that it is a modified version (not the ‘original’); and you must make your sources available for download according to these terms." In other words, I expect you to report modifications back to me (and I may extend the original accordingly), you can’t make it GPL, you should mention that your version is not the “original”, and your version should be released with the same licence.
Five or so years ago, I looked at the possibility of doing some stuff with Android. At the time, Orange France offered Usenet and I used to follow comp.sys.acorn using “Groundhog” which was pretty basic but open source. I installed the Android SDK and Eclipse and thought I’d try looking through the Groundhog source to see how it all fit together.
No #1: You may want to look to see how Printers actually produces output. It’s miraculous and OhMyGod in equal measure. ;-) No #2: What happens in a message passing setup if a task is pre-empted before it has had a chance to make its reply? A polling cycle without a reply would be taken as a recorded message failure, would it not? |
Rick Murray (539) 13806 posts |
The ironic thing is that you keep talking about what is and is not thread safe, despite our co-operative task switching working without major incident for over a quarter century and, at one point, a pre-emptive system proving that with some glue and string and gum you can pre-empt quite a few tasks that are “slow”. Indeed, my Wimp pre-emption proposal is no more fancy than “when enabled, the Wimp will swap you out after a delay” (a few centiseconds, perhaps), plus some smoke and mirrors to try to mitigate the problems of zombie windows and such. A task could wrap “lengthy code” in calls to enable/disable PMT; and an evil task could, I supposed, call Wimp_Initialise and then immediately turn on PMT and just run both ways at the same time (yuck)… The point is, not much consideration is being given to what is and is not “thread safe”, just as not much consideration occurred with this within RISC OS over the last nearly-thirty-years. Hell, even FilerAction sort of works. ;-) The thing with the Wimp is… programs should not be written to expect exclusive access to anything (other than files that they open). With the exception of specific hardware devices (serial port, for example), there isn’t much in RISC OS to claim exclusivity over. A disc editor has to run knowing that sensitive parts of the disc will need to be re-read before writing to ensure that file operations in another task have not changed things during the editing. Actually, low level stuff is best handled by a “helper module” which can pick up on service calls and events and be notified of activity that way. It is good practice to use helper modules for low level things; application code should not be banging on any sort of hardware. Just because you can doesn’t mean you should! |
h0bby1 (2567) 480 posts |
aaaaa |
h0bby1 (2567) 480 posts |
aaaaa |
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 ... 26