On Sun, Aug 30, 2009 at 01:25, Uri Guttman<u...@stemsystems.com> wrote: >>>>>> "CO" == Chas Owens <chas.ow...@gmail.com> writes: > > >> mmap is old (i used it over 20 years ago on sunos, way before linux even > >> existed). you could use it for shared ram backed by disk as it used the > >> vm for this. > CO> snip > > CO> I never said it was new, just modern. Lexical filehandles are modern, > CO> but they are over ten years old at this point. mmap has mostly > CO> replaced shared memory and therefore is the modern alternative. > > modern? for what definition of modern do you mean? again, i am talking c > and not perl. mmap is very old. i can't say which version of unix first > had it but i would bet BSD 4.0 or earlier. sunos was based on that.
I thought I had made it clear. Let me try again. Point to a newer thing that replaces mmap or shared memory. I haven't seen one. Shared memory is older than mmap, therefore mmap is the modern solution. Modern doesn't mean new, it is closer in meaning to current than new. snip > CO> pack and unpack are just another form of serialization, so I am not > CO> sure I understand your point (unless we are just saying the same > CO> thing). > > pack/unpack are not a form of serialization IMO. you can pack actual > addresses with the p/P formats. you can also directly access data via > offsets leaving gaps. both sides have to be extra careful with padding, > offsets, integer sizes, byte ordering (use network order), float formats > etc. it is very non-portable and should be best only used for access to > c level data structures. in any case this thread is way off topic for > the beginner's list and i think it is (and we) are exhausted. snip I didn't say it was a portable method of serialization, I said it was a method of serialization. And Storable has some of the same portability issues. That is why it has nfreeze. The pack function takes a list of Perl values and produces a string of bytes based on instructions given to it. This process, if the instructions did not destroy information, can be reversed by passing the instructions and string of bytes to unpack. I don't understand how you do not see that as serializing the list. Admittedly, it is a very primitive form of serialization that can go horribly wrong; which is why we have things like Storable. As for the ability to use just part of the serialized item, that doesn't make something not serialized. For instance, glade files are serialize widget trees. You can recreate the any node and all of its children without having to recreate the whole tree. -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/