Ok, this one is for Piru, or other experts out here:)
The bellow questions is in the context of the library I'm doing, which streams any data very easily. Appliable to all the many situations where serialization is usable (saving to HD, sending over the network etc,
actually those are the two only likely uses that have occurred to me regarding this code...).
You've probably seen a few posts of me mentioning it and Yesssss! I finally got the macros to a usable state;)

More
about them latter, I think you'll be surprised, I'm dead happy with what I've achieved and I've already got a few
ways to improve them even further, but thing is they're pretty usabble now and if I do more C macro coding I'll start to
through up (really...).
Anyway....

my idea for the library code, to make the thing rule, would be to have a circular buffer, to wich the library serializes the data and whose contents in turn can be streamed in smaller chunks, so that the library can continue to serialize data to other buffer's chunks, while one is being streamed at the same time in a piece big enouph to not hit performance. The streaming would happend a bit like the RawDoFmt() amiga rom function, with each library call that asks for serialization giving a pointer to a function that is called in a loop through the various chunks, wich does whatever the caller wants to do with it (save to hd, send through network...). The difference here is that RawDoFmt passed a char at a time to function, mine would pass a chunk to be much more performant. For this to work, the passed function has to be called in a separate library process that receives messages from the serializing library process, and that marks each chunk as being processed or not, after the function has returned.
So basically when the serialization reaches the chunk being used by the passed function the buffer becomes full and it waits for current function call to finish. Otherwise the data is being serialized to the buffer as it's contents are being used at the very same time.
Questions:
1- Generally, in most platforms, the library code is executed in the caller's memory space right ? Meaning that the separate library process can call passed function without any problems, otherwise the function could be accessing forbidden memory space for it. But in this case, the thing gets complicated because the library call sends a message to the process the calls the fucntion, so it might not work.
2- Do other platforms allow this easily ? I've done something a bit similar in the past with ports and signals and it was straightforward but I've done it on the Amiga (no memory protection). This one I want to be multiplatform, wich I think will probably be a big PITA...
3- What do you guys think of the model, do you advise any improvements ?
:pint: :pint: :pint:
Jose