Click Here
home features news forums classifieds faqs links search
6108 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
22 crawler(s) on-line.
 95 guest(s) on-line.
 2 member(s) on-line.


 zipper,  minator

You are an anonymous user.
Register Now!
 minator:  4 mins ago
 zipper:  4 mins ago
 amigakit:  8 mins ago
 g.bude:  9 mins ago
 Tpod:  13 mins ago
 Kronos:  23 mins ago
 matthey:  40 mins ago
 number6:  41 mins ago
 terminills:  52 mins ago
 AmigaMac:  55 mins ago

Internet News   Internet News : Memory Management in AmigaOS4.0 Explained
   posted by Rogue on 13-Dec-2005 21:05:03 (17737 reads)
A new article is available on os4.hyperion-entertainment.biz outlining the new and improved memory system on AmigaOS4.0. It describes the method of "slab allocators" and "object caching" that greatly reduce external memory fragmentation while keeping internal fragmentation to a guaranteed minimum and typically provides a constant-time memory allocation.

Read all about it on os4.hyperion-entertainment.biz.
    

STORYID: 2754
Related Links
· More about Internet News
· News by Rogue


Most read story about Internet News
IBM confirms POWER5 server release details

Last news about Internet News
Amiga Future issue 169 released
Printer Friendly Page  Send this Story to a Friend

Goto page ( 1 | 2 | 3 | 4 | 5 | 6 )

PosterThread
FrankBrana 
Re: Memory Management in AmigaOS4.0 Explained
Posted on 14-Dec-2005 17:48:17
#61 ]
Member
Joined: 13-Oct-2005
Posts: 54
From: Unknown

@Ami603

Quote:
Wasn't the Amiga philosophy something like:"if it works well for others,we'll benefit&improve it".


I really hope they arent doing that with the X86 family. I dont want to "benefit" of an improved slowtium4.

BTW, does anyone how to improve an X86?

-Frank

 Status: Offline
Profile     Report this post  
itix 
Re: Memory Management in AmigaOS4.0 Explained
Posted on 14-Dec-2005 18:07:15
#62 ]
Elite Member
Joined: 22-Dec-2004
Posts: 3398
From: Freedom world

Quote:

If others would only use PutMsg to put messages into the port, then it would work, but looking at the recent discussion on UtilityBase about abusing undocumented features in the system, you can imagine that some "clever" guys will queue up the message directly...


It was never forbidden by Commodore and struct MsgPort is documented anyway... there always are developers who find another way to do what they want. I have seen OS4 native code calling 68k ExecBase functions via Emulate() when another violates SysV ABI...


_________________
Amiga Developer
Amiga 500, Efika, Mac Mini and PowerBook

 Status: Offline
Profile     Report this post  
miksuh 
Re: Memory Management in AmigaOS4.0 Explained
Posted on 14-Dec-2005 18:51:32
#63 ]
Cult Member
Joined: 10-Mar-2003
Posts: 731
From: Espoo, Finland

@itix

Quote:
It was never forbidden by Commodore and struct MsgPort is documented anyway... there always are developers who find another way to do what they want.


When there is access functions like PutMsg() and GetMsg(), queueing messages directly would be wery bad programming style. It's not about programmers freedom to do things the way they want. It's about doing things so that your code and system will work as they should in the future too. Queueing messages directly would be sure way to brake your code when system structures change.

Same applies to those AllocVec discussions in the IntuitionBase. If you do not follow the official documentation then it's your own fault if your code wont work after internal system structures change. Those undocumented "features" are just hacks and using them is bad programming style.
If many guys use those undocumented things it wont make those any less hackish.

Last edited by miksuh on 14-Dec-2005 at 07:37 PM.
Last edited by miksuh on 14-Dec-2005 at 07:16 PM.
Last edited by miksuh on 14-Dec-2005 at 06:59 PM.

 Status: Offline
Profile     Report this post  
Tesla 
Re: Memory Management in AmigaOS4.0 Explained
Posted on 14-Dec-2005 19:24:10
#64 ]
Member
Joined: 23-Oct-2003
Posts: 80
From: Sweden

Quote:
The new system only discerns between MEMF_SHARED and MEMF_PRIVATE. The old flags are still supported because of backward compatibility.


Does this also apply to interrupt code?

Also, I wonder if the new memory system supports custom exception handlers for different
memory regions (which, as far as I understand it, would be a slab then).

This was indicated in an earlier draft of AmigaOS4 functionality and could e.g. be used to
map a set of frames to a file like the Unix mmap() functionality. (this can of course be
implemented in other ways too)

 Status: Offline
Profile     Report this post  
itix 
Re: Memory Management in AmigaOS4.0 Explained
Posted on 14-Dec-2005 20:17:44
#65 ]
Elite Member
Joined: 22-Dec-2004
Posts: 3398
From: Freedom world

AllocVec() is different case. Its internal behaviour is well known but it was never documented when struct MsgPort is. Changing MsgPort structure is next to impossible:

a) allocating one on your own has been valid from 1.0 to 3.9 and not forbidden in 4.0
b) there are no Set/Get methods to access MsgPort data (mp_SigBit...)
c) peeking to message list is needed sometimes anyway
d) feel free to fix struct Process (yes, I know there is GetProcMsgPort())


_________________
Amiga Developer
Amiga 500, Efika, Mac Mini and PowerBook

 Status: Offline
Profile     Report this post  
EntilZha 
Re: Memory Management in AmigaOS4.0 Explained
Posted on 14-Dec-2005 20:45:42
#66 ]
OS4 Core Developer
Joined: 27-Aug-2003
Posts: 1679
From: The Jedi Academy, Yavin 4

Quote:
It was never forbidden by Commodore and struct MsgPort is documented anyway...


No, but it is stupid regardless... there's PutMsg that will do what you need to put a message to a port... no need to do it yourself.

Quote:
there always are developers who find another way to do what they want.


Well, as long as they don't break rules, it's ok. Of course, all the structures on AmigaOS have always been open and even documented, which was a good thing back then, but it bites us in the back today...

However, and that's an important point, it's in most cases totally useless to go "short cuts" when there's a function that actually does what you are trying to accomplish... nevertheless, people do it.


_________________
Thomas, the kernel guy

"I don't have a frigging clue. I'm norwegian" -- Ole-Egil

All opinions expressed are my own and do not necessarily represent those of Hyperion Entertainment

 Status: Offline
Profile     Report this post  
EntilZha 
Re: Memory Management in AmigaOS4.0 Explained
Posted on 14-Dec-2005 20:48:16
#67 ]
OS4 Core Developer
Joined: 27-Aug-2003
Posts: 1679
From: The Jedi Academy, Yavin 4

Quote:
Does this also apply to interrupt code?


Yes. If in doubt, you can lock the memory in place.

Quote:
Also, I wonder if the new memory system supports custom exception handlers for different memory regions (which, as far as I understand it, would be a slab then).


Yes, it does support that, but that functionality is internal to the kernel libraries.

Quote:
This was indicated in an earlier draft of AmigaOS4 functionality and could e.g. be used to map a set of frames to a file like the Unix mmap() functionality. (this can of course be implemented in other ways too)


This will be offered later as an encapsulated interface, i.e. you don't do that by hand, you'll have functions for that.


_________________
Thomas, the kernel guy

"I don't have a frigging clue. I'm norwegian" -- Ole-Egil

All opinions expressed are my own and do not necessarily represent those of Hyperion Entertainment

 Status: Offline
Profile     Report this post  
EntilZha 
Re: Memory Management in AmigaOS4.0 Explained
Posted on 14-Dec-2005 20:50:47
#68 ]
OS4 Core Developer
Joined: 27-Aug-2003
Posts: 1679
From: The Jedi Academy, Yavin 4

Quote:
Changing MsgPort structure is next to impossible:


Actually, it is possible. Every port (and most system structure) start with a node structure. The node type can be set to something different (let's say NT_NEWPORT), and the functions can then act accordingly.

Since we now have a function (AllocSysObject) that is used to allocate such structures, it's possible...


_________________
Thomas, the kernel guy

"I don't have a frigging clue. I'm norwegian" -- Ole-Egil

All opinions expressed are my own and do not necessarily represent those of Hyperion Entertainment

 Status: Offline
Profile     Report this post  
Georg 
Re: Memory Management in AmigaOS4.0 Explained
Posted on 14-Dec-2005 20:54:15
#69 ]
Regular Member
Joined: 14-May-2003
Posts: 452
From: Unknown

@itix

e) Direct messing around with MsgPort struct is used everywhere and by everyone. Including examples in autodocs, examples on DEV CDs. Done by all kind of coders, including OS3 coders, OS4 coders, AROS coders, MorphOS coders. Present in apps for all these OSes, including apps which are part of the OS itself. No need to be clever to come up with such code. It's normal code. A good example is CloseWindowSafely.

 Status: Offline
Profile     Report this post  
miksuh 
Re: Memory Management in AmigaOS4.0 Explained
Posted on 14-Dec-2005 21:41:24
#70 ]
Cult Member
Joined: 10-Mar-2003
Posts: 731
From: Espoo, Finland

@itix

MsgPort is now just an example. I'm sure you have heard about abstract datatype. MsgPort is almost like an abstract datatype: it has internal storage structure and access functions for it. Ofcourse it would be more abstract if typedef struct {} MsgPort; would have been used instead of struct MsgPort {}. ADT should be like black box, which internal implementation is not important. So there is no need for public documents of the internal structure. Anyway you should never ever access internal ADT structure directly, even if you can, because if you do so then you loose the benefits of abstraction. You create unnesessary dependencies which will make future changes difficult or impossible. Accessing those structures directly was nice in the 80's and early 90's, but not today when ADT and OO is preferred. Unfortunately AmigaOS was designed to be a bit too open.

Last edited by miksuh on 14-Dec-2005 at 10:47 PM.
Last edited by miksuh on 14-Dec-2005 at 10:38 PM.
Last edited by miksuh on 14-Dec-2005 at 09:48 PM.
Last edited by miksuh on 14-Dec-2005 at 09:47 PM.

 Status: Offline
Profile     Report this post  
Anonymous 
Re: Memory Management in AmigaOS4.0 Explained
Posted on 14-Dec-2005 22:30:11
# ]



Hi to all the Naysayers,


AOS: Here yesterday, today, AND tomorrow!!


Have a nice day!

 
     Report this post  
Zardoz 
Re: Memory Management in AmigaOS4.0 Explained
Posted on 14-Dec-2005 22:39:35
#72 ]
Team Member
Joined: 13-Mar-2003
Posts: 4261
From: Unknown

I can see people having a nice technical discussion here, no acting like nay-sayers.


_________________

 Status: Offline
Profile     Report this post  
Ami603 
Re: Memory Management in AmigaOS4.0 Explained
Posted on 14-Dec-2005 22:51:01
#73 ]
Cult Member
Joined: 7-Mar-2003
Posts: 580
From: Valencia,Spain 8-)

AMiGR:
And as long as it can be kept this way, i'm really sure we all will benefit from some interesting points.
Everything that tries to push our system further,taking advantage of today's standards is a win-win situation.Yes i know that AmigaOS in its current incarnations and legacy baggage may have some limits, don't forget that it hasn't been in active development since quite some years,but in the meanwhile we are enjoying its growing stage.


_________________
Cuida tus piedras gordas.

A1200/030 32Mb
A4000D
A1-X1000.

 Status: Offline
Profile     Report this post  
Anonymous 
Re: Memory Management in AmigaOS4.0 Explained
Posted on 14-Dec-2005 23:29:56
# ]



I read about it Sounds very interesting and promising They
are really pushing the OS4 even further into perfection!

And Hyperion LOVE teasing us by giving us these facts, in time
for the final release we still don't know about

Hyperion, you guys are freakin' COOL!

 
     Report this post  
miksuh 
Re: Memory Management in AmigaOS4.0 Explained
Posted on 15-Dec-2005 0:04:33
#75 ]
Cult Member
Joined: 10-Mar-2003
Posts: 731
From: Espoo, Finland

@Helgis

Yep, good work again I like the way how OS4 is modernized piece by piece.

Last edited by miksuh on 15-Dec-2005 at 12:14 AM.

 Status: Offline
Profile     Report this post  
Anonymous 
Re: Memory Management in AmigaOS4.0 Explained
Posted on 15-Dec-2005 0:13:33
# ]



@Milush

Thank you Hope i spelled your nick correctly.
If not, then forgive me

 
     Report this post  
miksuh 
Re: Memory Management in AmigaOS4.0 Explained
Posted on 15-Dec-2005 0:18:12
#77 ]
Cult Member
Joined: 10-Mar-2003
Posts: 731
From: Espoo, Finland

@helgis

You didn't But it does not matter

Logic behind my nick is quite simple My firstname is Mika, some of my friends call me as Miksu, and my surname starts with H. So that's why it's miksuh

Last edited by miksuh on 15-Dec-2005 at 12:23 AM.

 Status: Offline
Profile     Report this post  
Anonymous 
Re: Memory Management in AmigaOS4.0 Explained
Posted on 15-Dec-2005 0:46:58
# ]



Hi miksuh,


I use "copy" and "paste" so I got it right.

Quote:
miksuh wrote:

Logic behind my nick is quite simple My firstname is Mika, some of my friends call me as Miksu, and my surname starts with H. So that's why it's miksuh


The first and last letters should be capital, then.

MiksuH



Hi AMiGR,

No, no naysaying going on here, but those people, they're looking in, gnashing their teeth, I can hear it.


Hear this....

(micro)AmigaOne! AOS4.0! Ready before it was made!

Okay, doesn't make much sense, so I'll do better next time.

 
     Report this post  
EntilZha 
Re: Memory Management in AmigaOS4.0 Explained
Posted on 15-Dec-2005 1:17:22
#79 ]
OS4 Core Developer
Joined: 27-Aug-2003
Posts: 1679
From: The Jedi Academy, Yavin 4

Quote:
A good example is CloseWindowSafely.


Right, that's one of the unfortunate instances where it's necessary. Still, a lot of people DO access system structures even if they don't need to. That isn't limited to message ports. It's all over the place. And _MOST_ of these accesses are completely unnecessary.


_________________
Thomas, the kernel guy

"I don't have a frigging clue. I'm norwegian" -- Ole-Egil

All opinions expressed are my own and do not necessarily represent those of Hyperion Entertainment

 Status: Offline
Profile     Report this post  
Rogue 
Re: Memory Management in AmigaOS4.0 Explained
Posted on 15-Dec-2005 1:21:45
#80 ]
OS4 Core Developer
Joined: 14-Jul-2003
Posts: 3999
From: Unknown

Quote:
A good example is CloseWindowSafely.


Unfortunately, yes... Commodore has always been to easy with internal system structures. Matter of fact is that the Autodocs and RKM are full of bad examples, and full of actually wrong examples (the BOOPSI example code is especially bugged).

At one point these things must change, but introducing a new API for it now is going to be too much of a hassle... Things are bound to change later down the road anyway.

CloseWindowSafely isn't required anymore BTW, that is internally handled by Intuition.


_________________
Seriously, if you want to contact me do not bother sending me a PM here. Write me a mail

 Status: Offline
Profile     Report this post  

Goto page ( 1 | 2 | 3 | 4 | 5 | 6 )

[ 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