Author Topic: SMP Update?  (Read 2063 times)

Samurai_Crow

  • Newbie
  • *
  • Posts: 32
  • Karma: +0/-0
  • Hobby coder
Re: SMP Update?
« Reply #15 on: January 02, 2019, 08:48:13 PM »
From what I understood the Vampire is a FPGA board where one CPU must do everything. No custom shipsets like Amiga had.

In that scence the Pi is more Amiga like. So much is done with the GPU these days. Video, 3D, 2D.

SMP is very difficult without breaking everything. It is still possibly a good idea to fork AROS and have a version people can play with on top of the classic version. It is what Mschulz is doing. I'm quite sure he got it right. I'm more unsure about where a forked AROS version is going. Just look at Haiku and how many years that OS been in development without any success. Where does a new OS fit inn and how long are people going to wait for it to be usable.
AROS just recently, with the right hardware became a stable, good OS.
...
The copper, audio and bitplane DMA are still there in the Vampire.  The blitter needs software emulation but that's mainly because the timing needs to go slow to run most old software.  When it's running full speed on the second CPU thread it's roughly 200 times the speed of the original blitter.  Also, Gunnar has said he's going to add 3D support to the v4 Vampire cards.

As for ARIX, its goal is to run AROS software on Linux drivers.  It's a good fork for modern equipment.  Once the modern hardware is running ARIX, AROS will be free to relapse into retrocomputing on the Amiga hardware.

Even so, it will be nice having both for their respective platforms.

nikos

  • Member
  • ***
  • Posts: 135
  • Karma: +2/-1
    • aspireos
Re: SMP Update?
« Reply #16 on: January 02, 2019, 11:33:02 PM »
From what I understood the Vampire is a FPGA board where one CPU must do everything. No custom shipsets like Amiga had.

In that scence the Pi is more Amiga like. So much is done with the GPU these days. Video, 3D, 2D.

SMP is very difficult without breaking everything. It is still possibly a good idea to fork AROS and have a version people can play with on top of the classic version. It is what Mschulz is doing. I'm quite sure he got it right. I'm more unsure about where a forked AROS version is going. Just look at Haiku and how many years that OS been in development without any success. Where does a new OS fit inn and how long are people going to wait for it to be usable.
AROS just recently, with the right hardware became a stable, good OS.
...
The copper, audio and bitplane DMA are still there in the Vampire.  The blitter needs software emulation but that's mainly because the timing needs to go slow to run most old software.  When it's running full speed on the second CPU thread it's roughly 200 times the speed of the original blitter.  Also, Gunnar has said he's going to add 3D support to the v4 Vampire cards.

As for ARIX, its goal is to run AROS software on Linux drivers.  It's a good fork for modern equipment.  Once the modern hardware is running ARIX, AROS will be free to relapse into retrocomputing on the Amiga hardware.

Even so, it will be nice having both for their respective platforms.

For ARIX you are wrong. The original idea was that but that is not what Mschulz is doing now. AROS software will not run on it.

How is Gunnar going to add 3D support? Is there expansion slot for GPU or is he doing some fpga 3D on other core?

Audio today is almost no task for main CPU. It is the GPU that is important.

Samurai_Crow

  • Newbie
  • *
  • Posts: 32
  • Karma: +0/-0
  • Hobby coder
Re: SMP Update?
« Reply #17 on: January 03, 2019, 06:07:58 AM »
The "Polly" core is the polygon plotter on the bigger v4 Vampire.  It still runs on the FPGA.
« Last Edit: January 03, 2019, 09:44:13 PM by Samurai_Crow »

trekiej

  • Member
  • ***
  • Posts: 106
  • Karma: +0/-0
Re: SMP Update?
« Reply #18 on: January 06, 2019, 11:02:28 PM »
If I understood correctly, Arix allows Linux to be programmed in an Amiga or Aros way.

Could someone tell me how many different programming languages are there for Aros SMP or is Pascal available for SMP?

magorium

  • Junior Member
  • **
  • Posts: 89
  • Karma: +0/-0
Re: SMP Update?
« Reply #19 on: January 08, 2019, 12:29:14 AM »
Could someone tell me how many different programming languages are there for Aros SMP or is Pascal available for SMP?
SMP is something that the kernel/scheduler has to support. In that regards it has nothing to do with the programming language (whatever programming language that would be).

As long as the API exposes things like creating threads/task then it can be used by any programming language.

Depending on the SMP implementation that is not even necessary in case the scheduler takes care of things automatically (e.g. new threads/task are distributed (evenly) automatically).

Creating multithreading applications with Pascal even when thread support was not implemented was already possible because the Amiga/AROS API exposes functionality for that. At this day the Pascal threading model is supported for Amiga/AROS so that you would not have to deal with those API calls yourself.

Free Pascal is available for 64-bit AROS and afaik that also means for SMP enabled version of AROS. Make sure to verify with ALB42 in case you need to be sure.

But, in all fairness. All talk about using multiple threads is wonderful but in practise it is much harder to actually make use of it (correctly). I dare to say that almost (or even more of) 90% of end-user applications have no use for running on multiple cores/threads whatsoever.

In relation to your interrest with regards to rendering: yes, for such (specific) tasks it matters if you are able to utilize all processors/cores :)

trekiej

  • Member
  • ***
  • Posts: 106
  • Karma: +0/-0
Re: SMP Update?
« Reply #20 on: January 08, 2019, 01:29:57 AM »
So, when does a program get turned into threads?
I would like to see Povray 3.7 ported to Aros SMP.
It is multi-threaded.

magorium

  • Junior Member
  • **
  • Posts: 89
  • Karma: +0/-0
Re: SMP Update?
« Reply #21 on: January 08, 2019, 03:02:28 AM »
So, when does a program get turned into threads?
Well, that was kind of the point i was trying to make :)

A program doesn't "get turned into threads" automatically. Instead the developer has to design the application (upfront) in such a way that it is able to utilize threads (efficiently).

And in some programs that can be or are programmed in a linear fashion, it makes no sense whatsoever to make use of threads. Sure such programs can still make use of threads but it sometimes simply doesn't make any sense (other then being a lazy programmer/developer).

Consider the following simple example (bear with me as the example itself make no sense whatsoever):
Code: [Select]
x = 0
for n = 1 to 100
  x = x + 1
next n

Simple enough: a variable x get increased by one on every iteration of the for next loop. For example sake let say that every loop iteration (and corresponding addition of 1 to the variable x) costs 1 second of time.

That will amount for this program to take at least 100 seconds to finish.

Using threads is about running things in parrallel so that multiple threads/cores can be used to process the code. That way (in theory) you should be able to rewrite the exampe to use (again for argument sake let ay you have that many) 100 threads/cores at the same time. That way it should take 1 second for 100 iterations as all 100 are executed at exactly the same time (and processed by the CPU).

oversimplified example:
Code: [Select]
// thread code:
x = 0
for n = 1 to 100
  StartThread(AddOne)
next

AddOne:
  x = x + 1
return

Taking into account that a (single global) variable can not be acccessed by all 100 threads/cores at the same time (that is a design principle of using multiple threads) and that you have to create a 100 different threads, this will add so much overhead that in the end your program will not end up finishing in 1 second, rather in 200 seconds (because of the extra overhead of creation and destruction of the threads).

So, programs like povray are designed in such a way that they (efficiently) make use of threads. It is a bit out of scope to get into detail what exact portions/calculations are eligable to turn into threads but i hope the gist of it is a bit more clear for you now.

Furthermore (in case you wondered), there are different kernels that implement their own threading model, each with their own set of API calls. AROS/Amiga is not 100% compatible to support all thread API used by povray (or any program written for another platform and that makes use of threads for that matter), so that sometimes poses a problem for (easily) making a port for Amiga/AROS.

For instance the initial threading implementation used by Free Pascal was based on the version implemented by Delphi. But alas, Free Pascal supports more platforms than Windows (and Linux) so the threading implementation had to obey certain basic rules that apply for all platforms that supports threads. Therefor a lot of bad design stuff (like stopping and resuming threads) is highly discouraged and isn't officially supported anymore.

And that is ok, because you can always use your platform specific API calls in case you do wish to support functionality that's missing from Free Pascal's native threading implementation/solution (in case you really can't live without)

trekiej

  • Member
  • ***
  • Posts: 106
  • Karma: +0/-0
Re: SMP Update?
« Reply #22 on: January 08, 2019, 05:15:25 AM »
I heard that BeOS could make all its programs multi-threaded automatically.
But.
A cube, for example, has 8 vertex that need to be calculated when Rotate, Scale, and Translation is performed.
Delta Radian, Delta Size, Delta Position is placed on it.

I hear that a Ray Tracer is not hard to program. Configuring the block size before the Enter button is pressed would necessary.

magorium

  • Junior Member
  • **
  • Posts: 89
  • Karma: +0/-0
Re: SMP Update?
« Reply #23 on: January 08, 2019, 06:31:20 AM »
I heard that BeOS could make all its programs multi-threaded automatically.
No idea but sounds like a fairy-tale to me. BeOS is even more dead than AROS and its sources are closed so i am unable to verify. If you are able then please provide a link so i'm able to educate myself.

Quote
I hear that a Ray Tracer is not hard to program. Configuring the block size before the Enter button is pressed would necessary.
Oh, i would have no idea, but perhaps ALB does  ;) Also nice is physics.

Free Pascal for AROS is ready..... even for SMP .... so ... what was it that is keeping you from writing software ?  :)
« Last Edit: January 08, 2019, 06:40:06 AM by magorium »

trekiej

  • Member
  • ***
  • Posts: 106
  • Karma: +0/-0
Re: SMP Update?
« Reply #24 on: January 08, 2019, 06:42:25 AM »
I have 3 books that I have been studying. One is Pascal for Basic programmers, the second is Introduction to Computing with Pascal, and the third Data Structures with Pascal.
I bought Turbo Pascal(?) for Ms-dos from a community college a long time ago. It has books with it.

magorium

  • Junior Member
  • **
  • Posts: 89
  • Karma: +0/-0
Re: SMP Update?
« Reply #25 on: January 08, 2019, 07:09:22 AM »
This, this and this books ?

Do note that judging by their age their are mostly (if not all) oriented at using Turbo Pascal (not even Borland Pascal) or using iso Pascal. These are dialects that can be compiled with Free Pascal however the world has moved on since then.

Some of the books you mentioned are pretty good at introducing you to the use of data structures and some elementary basics (for any programming language usage) but we have entered the world of OOP (Object Oriented Programming) ages ago. OOP is a bit more difficult topic to learn but makes life much easier (and more understandable even).

See also this online book for a quick introduction to modern Pascal.

Advanced Records, Objects, Classes, Custom Operators, Helpers, Enumerators, Generics,  etc. are things that are more used in this day and age and you won't be able to read about in forementioned books.

Do note that having a understanding of the basics like written in the books you mentioned is a very good place to start. If there are any example code listed with those books then just play with those in case you get bored with the explanations. By doing things most people tend to have a better idea on what is actually going on, the absolute worse that can happen is that you crash your OS (but (Free)Pascal is a language that is pretty good at attempting to prevent you from doing so but be warned for this to happen when working with pointers.... most programmers have brought down their OS with those  :D )

Ah well, if you have questions then you know where to ask  ;)

trekiej

  • Member
  • ***
  • Posts: 106
  • Karma: +0/-0
Re: SMP Update?
« Reply #26 on: January 08, 2019, 06:55:24 PM »
Correct except for the third one. The author is Horowitz and Sahni.
I have had an introduction to C and C++. Also I have had an introduction to COBOL and Assembly Language.
Edit:
I have worked with pointers some in C.

magorium

  • Junior Member
  • **
  • Posts: 89
  • Karma: +0/-0
Re: SMP Update?
« Reply #27 on: January 09, 2019, 05:08:28 AM »
Quote
Correct except for the third one. The author is Horowitz and Sahni.
Ah, ok. i seem to remember having read that book back in the day (one of the earlier editions though). Thanks for the correction.

Quote
I have had an introduction to C and C++. Also I have had an introduction to COBOL and Assembly Language.
Edit:
I have worked with pointers some in C.
Ok, that is good to know. I initially thought you had no experience at all other then some tinkering with your Amiga/AROS box (scripting and such).

COBOL ? Then you either are much older then i gave you credit for (in which case respect) , have a very boring job or have a prety peculiar hobby :)

I'm biased when it comes to advocating Pascal but the step from COBOL to Pascal shouldn't be too awkward even though COBOL has a completely other purpose for its existance.

C can be much more cryptic in that regards even though the same can be said about Pascal if you put some effort into it. Personally i generally just dislike the output that c compilers produce (and with that i meant the error reporting as that seems to require a study on its own in order to be able to interpret correctly).

Having some knowledge on Assembly is always a good thing as that really throws you back to bare basic instructions. Also allows you to appreciate programming languages better (at least some of them  :D ) If you have more affinity with assembly then c might perhaps be more interresting for you.

But.. we're getting waaay off-topic here. Feel free to start another thread in case you wish to have some chit-chat about your endeavours and in case i don't bore you to death with my ramblings :)

PurpleMelbourne

  • Newbie
  • *
  • Posts: 32
  • Karma: +0/-0
Re: SMP Update?
« Reply #28 on: January 09, 2019, 05:28:52 AM »
I heard that BeOS could make all its programs multi-threaded automatically.

I don't think that is correct.
Haiku is the BeOS equivalent of AROS. The original BeOS went to Palm (as in PalmPilot) then to HP, then to LG and now it is on LG televisions as WebOS. So its still around, but as a smart TV control system. But Haiku is still on the Desktop and looks good.

What I've seen of comments is talking about a good Be style program as having lots of threads. They weren't put there automatically. Good programmers following the guidelines make them very multi-threaded so that OS can split them efficiently over the CPU cores. But its not automatic.

BTW I think that everything good about Haiku could be added into Amiga too  :)

trekiej

  • Member
  • ***
  • Posts: 106
  • Karma: +0/-0
Re: SMP Update?
« Reply #29 on: January 09, 2019, 05:34:06 AM »
Unfortunately, I have never been a Pro. Programmer.
Cobol was done in clas back in Fall 2004, Assembly as well.
C was in 2002.
I need to start a blog for this.
I do have a blog, it is about my A1000 ROM switcher board.

Thanks again, I hope to hit the books more soon. I have two classes coming up this Spring.
After that back to math classes and teacher cert. classes.