Ludovico (and Philippe),

I sent an email earlier to Philippe telling him I was sure the boost
libraries don't work, however, I just ran your test code and it worked fine
on VS2005. 

This leaves a bigger mystery as to why events keep running around on exit
and crashing. I'll check into the patches next as I'm using a slightly out
of date 2.0.

It might be as simple as there is a race condition where the delete happens
after the event has fired but before the event has completed. If that is so,
then there's a lot of mutexes to be added.

The example would look like (my code is very crude):

Trackable A;
Main(){
        A = new Trackable();
        Sig.connect(&A::fire, A);
        Thread1(); // an async call
        Thread2(); // an async call
        Join_the_threads();
}

Thread1() {
        Sig.fire();
}

A::fire() {
        wait(2000); // millis
        A_member_object.some_method(); // will be undefined
}

Thread2(){
        delete A;
}

From: http://www.boost.org/doc/html/signals/s04.html

"2.  Is Boost.Signals thread-safe?
 
 No. Using Boost.Signals in a multithreaded concept is very dangerous, and
it is very likely that the results will be less than satisfying.
Boost.Signals will support thread safety in the future."

How does the code deal with the fact that boost::signals aren't threadsafe?
It must be there that some of the problems are arising, no? (I've seen the
EventHandlerThreadSafe pattern. Are there others?)

Sorry if I am asking obvious or stupid questions.

-Lukas
 
Lukas Oberhuber

-----Original Message-----
From: Ludovico Cavedon [mailto:[EMAIL PROTECTED] 
Sent: 03 January 2007 23:42
To: Lukas Oberhuber
Cc: [email protected]
Subject: Re: [Wengophone-devel] Persistent Crashes on Exit - Event problems

Hi!

Are you sure you are not using gcc 4.1 (see
http://thread.gmane.org/gmane.comp.voip.wengophone.devel/3514) and some
particular version of Qt4.2
(http://thread.gmane.org/gmane.comp.voip.wengophone.devel/3545)?
In these cases automatic slot disconnection is not working.

Moreover, I have no longer crashes at exit using these two patches:
http://dev.openwengo.com/trac/openwengo/trac.cgi/ticket/1199
http://dev.openwengo.com/trac/openwengo/trac.cgi/ticket/1259

Bye,
Ludovico

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


_______________________________________________
Wengophone-devel mailing list
[email protected]
http://dev.openwengo.com/mailman/listinfo/wengophone-devel

Reply via email to