On 2010-12-17 16:47:05 -0500, wrzosk <[email protected]> said:

I believe that when new thread is being created, all static data is initialized inside new thread. What worries me is the fact, that many 'mini' threads will initialize all static data inside application. This may be somewhat time consuming. Maybe there should be a possibility to define 'Pure' thread that doesnt touch any static data, and in turn it could leave static constructors untouched.

What do you think

You mean something like this:

        pure void doSomething(Tid parent) {
                int result = 1 + 1;
                parent.sendMessage(result);
        }

        void main() {
                spawn(&doSomething);
                ... wait for message ...
        }

Perhaps 'spawn' could do this when you feed it with a pure function.

--
Michel Fortin
[email protected]
http://michelf.com/

Reply via email to