Patch for the producer_consumer test -> by Felix Yen.

Dhruv Matani
Tue Mar 23 16:01:00 GMT 2004

	Here is a patch for the 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 
<End Quote>

//See patch for more info.

	-Dhruv Matani.

Proud to be a Vegetarian.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.prod_consumer.fyw
Type: text/x-patch
Size: 1324 bytes
Desc: not available
URL: <>

More information about the Libstdc++ mailing list