Topic
3 replies Latest Post - ‏2012-10-03T13:06:35Z by brataj
DaveyC
DaveyC
51 Posts
ACCEPTED ANSWER

Pinned topic Metal C heap serialization

‏2012-09-27T03:28:19Z |
Is the Metal C heap serialized? I think the answer to my question is no from what I can gather (stepping through the malloc/free code with a debugger).
If not I suggest you document this fact as it may come as a surprise to some!

David Crayford
Updated on 2012-10-03T13:06:35Z at 2012-10-03T13:06:35Z by brataj
  • brataj
    brataj
    11 Posts
    ACCEPTED ANSWER

    Re: Metal C heap serialization

    ‏2012-09-27T19:26:49Z  in response to DaveyC
    The Metal C runtime is intentionally very light and not intended to support multiple threads.

    What is it that you are doing that you would need to do heap serialization?
    • DaveyC
      DaveyC
      51 Posts
      ACCEPTED ANSWER

      Re: Metal C heap serialization

      ‏2012-10-03T09:23:49Z  in response to brataj
      I've got a concurrent hash map that works great in LE but the Metal C memory management is the point of failure. I think I may just port jemalloc and implement the atomics.

      BTW, I think it was a mistake to implement such a light runtime for a systems programming environment! We multi-task in systems programming...

      David Crayford
  • brataj
    brataj
    11 Posts
    ACCEPTED ANSWER

    Re: Metal C heap serialization

    ‏2012-10-03T13:06:35Z  in response to DaveyC
    I take it then you're sharing the heap environment created via __cinit() among your several threads, but each thread is a "main" Metal C program.