>Coen Schalkwijk wrote:
>>Ok. Could you (or anyone else?) tell me more about this, so I can
>>take this into account?
>
>Picture this:
[...]

Not quite, the problem is more likely to be something like this, which
Marcus Agehall also has mentioned:

roxen_module.pike:

  object B;
  f() {
    references B;
  }

  void start()
  {
    Thread.thread_create(f);
  }

When Roxen loads the module, it will in essence do something like:

  modules += ({ (program)"roxen_module.pike"() });
  modules->start();

When time comes to shutdown Roxen will do something like:

  modules->stop();
  map(modules, destruct);
  // Other stuff...
  exit(0);

The problem here is that the thread started in start() will continue
to run although its object has been destructed.

The fix is to implement a stop() in the module that makes sure that
all threads belonging to the module have terminated before returning.

>From the backtraces that you get, you should be able to identify from
where the problematic thread originated.

>This has little to do with the garbage collector, but more with when what
>variables are destroyed (explicitly) in stop() functions of e.g. class A.

True.

>Stephen.
  • Re: ... Marcus Agehall (nu med K-m�rkt fastighet) @ Pike (-) developers forum
  • Re: ... Coen Schalkwijk
  • Re: ... Marcus Agehall (nu med K-m�rkt fastighet) @ Pike (-) developers forum
  • Re: ... Coen Schalkwijk
  • Re: ... Marcus Agehall (nu med K-m�rkt fastighet) @ Pike (-) developers forum
  • Re: ... Coen Schalkwijk
  • Re: ... Stephen R. van den Berg
  • Re: ... Coen Schalkwijk
  • Re: ... Stephen R. van den Berg
  • Re: ... Coen Schalkwijk
  • Re: ... Henrik Grubbstr�m (Lysator) @ Pike (-) developers forum
  • Re: ... Coen Schalkwijk

Reply via email to