Patch for the producer_consumer test -> by Felix Yen.
Tue Mar 23 16:01:00 GMT 2004
Here is a patch for the producer_consumer.cc test that Felix Yen had
conveyed to me by provate email, so it should probably be merged with
mainline. The message body said:
I haven't looked at the code for a while, but the version I ghost wrote
had a bug in it that made it much slower than it should be. The
producer's algorithm should be linear, but it's quadratic in most
cases. Strictly speaking, the test is still fair, but it dilutes the
cost of allocating with excessive/unnecessary container traversals.
I'd start by modifying the test as follows. The body of the push_back
method should not call size(); instead, it should look something like
//See patch for more info.
Proud to be a Vegetarian.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1324 bytes
Desc: not available
More information about the Libstdc++