Boost logo

Boost Users :

Subject: Re: [Boost-users] the problem about boost trim function in multi-thread
From: Hu Jing (huj.nju_at_[hidden])
Date: 2012-06-20 21:16:08


>>That should be really easy to test.
>>How does your test code perform if you change it to this:
>>
>>void *TrimNString(void *arg) {
>>
>> string base ="fdsffdsafdsa";
>> locale loc = locale();
>> for(int i = 0; i != 50000000;i++)
>> {
>> string str = base;
>> trim(str, loc);
>> }
>> return 0;
>> }

>> Note also that trim calls the locale to look for whitespace, which is
more flexible than your test for " \r\n\t".
>> That's probably a significant performance difference, too.
I have try you method, But it doesn't work.
I don't think that boost trim using the locale cause the problem.
In the single thread envoriment, the program has the same running time as
the my test. so it does't change the program complexity.



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net