www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - gc

reply sclytrack <sclytrack idiot.com> writes:
Is it possible to have multiple gc
Mar 27 2010
parent reply sclytrack <idiot hotmail.com> writes:
gc1    thread1
       thread2
       thread3

gc2    thread4
       thread5

when the gc1 cycles it does not block the gc2 threads. Would that be of any use?
Or possible. And only use communication like between two processes, some
interprocess communication message passing thing.
I mean the entire pure thing makes heavy use of the garbage collector, maybe
isolating them is a solution, just let it cycle independent from the rest.
But on the other hand you could just make two processes.







Reflection------>Serialization----->Remoting

1) Reflection

 transient [NonSerialized]

2) Serialization

Some form of reflection would be handy to simplify the serialization.
Also the use of the notion "Property" comes in handy, as to which
fields are selected.

3) Remoting

There are serialization libraries outside of phobos like in tango but they
must be put into phobos itself and the Exception needs to be serializable
too in order for the "remoting" thing to work.

When communicating between "Application Domains" like in C# when inheriting
from exceptions, you need to make sure that the exception class is serializable.

class Exception:ISerializable
{
}


I can't find the Exception class anywhere, where is that defined?
in core.exception there is some Error stuff. Is it defined in the compiler
then?
Mar 27 2010
parent "Simen kjaeraas" <simen.kjaras gmail.com> writes:
sclytrack <idiot hotmail.com> wrote:

 gc1    thread1
        thread2
        thread3

 gc2    thread4
        thread5

 when the gc1 cycles it does not block the gc2 threads. Would that be of  
 any use?
 Or possible. And only use communication like between two processes, some
 interprocess communication message passing thing.
 I mean the entire pure thing makes heavy use of the garbage collector,  
 maybe
 isolating them is a solution, just let it cycle independent from the  
 rest.
 But on the other hand you could just make two processes.

This has been discussed for D2's concurrency system, often in conjunction with per-thread heaps. The most likely system (as far as I've understood), is a global GC in the main thread, that takes care of shared objects, and per-thread GCs for thread-local storage. Problems may occur when objects are moved from one thread to another, or when created in one thread and later cast to shared. Granted, I am no GC expert, so everything written above should be taken a pinch or two of salt. -- Simen
Mar 28 2010