Boost logo

Boost :

Subject: Re: [boost] boost::signal poor performance
From: Wang Yun (a_hao_at_[hidden])
Date: 2008-09-24 23:08:47


Hi, I met a crash when define _SECURE_SCL=0 in release mode
but in debug mode, it's ok, I'm using VC2005.

in e:\libraries\boost_1_36_0\boost\signals\detail\named_slot_map.hpp

 void init_next_group()
  {
    while (group != last_group && group->second.empty()) ++group;
    if (group != last_group) {
      slot_ = group->second.begin(); // crash and debugger stops at here
      slot_assigned = true;
    }
  }

//////// code below

class TestSignal
{
public:

    int counter;

    void OnEventReceived(char b)
    {
        counter++;
    }
};

int _tmain(int argc, _TCHAR* argv[])
{
    int const times = 100000;

    TestSignal testSignal;
    boost::signal<void (char)> sig;

    sig.connect(boost::bind(&TestSignal::OnEventReceived,&testSignal,_1));

    for(int i = 0; i < times; i++)
    {
        sig('a');
    }
}


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk