sasadipo / google-concurrency-library Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/google-concurrency-library
Automatically exported from code.google.com/p/google-concurrency-library
What steps will reproduce the problem?
1. Create a non-copyable object.
2. Output the object using a stream_mutex<std::ostream>
3. Compile.
What is the expected output? What do you see instead?
Compilation should succeed, however the compiler reports fails indicating
that it is attempting to copy a non-copyable object.
What version of the product are you using? On what operating system?
scrolllinux3:~/svn/google-concurrency-library-read-only 0:13> svn info
Path: .
URL: http://google-concurrency-library.googlecode.com/svn
Repository Root: http://google-concurrency-library.googlecode.com/svn
Repository UUID: 003f9db4-d5f8-dca4-bccd-e9ef3f936871
Revision: 121
Node Kind: directory
Schedule: normal
Last Changed Author: alasdair.mackintosh
Last Changed Rev: 121
Last Changed Date: 2013-04-18 19:44:32 -0500 (Thu, 18 Apr 2013)
scrolllinux3:~/svn/google-concurrency-library-read-only 0:14> cat /etc/issue
Ubuntu 12.04.2 LTS \n \l
Please provide any additional information below.
I added the following code to testing/stream_mutex_test.cc (line
numbers added for reference) and attempted to compile under gcc 4.6.4.
26 struct NonCopyable
27 {
28 NonCopyable() {};
29 private:
30 NonCopyable(const NonCopyable&) {};
31 };
32
33 std::ostream& operator<<(std::ostream& os, const NonCopyable&)
34 {
35 return os << "non-copyable";
36 }
37
38 void noncopyable(stream_mutex<std::ostream>& mstream)
39 {
40 NonCopyable v;
41 mstream << v << std::endl;
42 }
43
44 void noncopyable(std::ostream& ostream)
45 {
46 NonCopyable v;
47 ostream << v << std::endl;
48 }
Compilation fails in the stream_mutex<std::ostream> version of noncopyable:
make[1]: Entering directory
`/localhome/scroll/svn/google-concurrency-library-read-only/dbg98'
g++ -MMD -MP -Wall -Werror -Wno-error=c++0x-compat -I. -I../include -g3
-std=c++98 -Wno-c++0x-compat -I../third_party/googletest/include
-I../third_party/googlemock/include ../testing/stream_mutex_test.cc -c -o
stream_mutex_test.o
../testing/stream_mutex_test.cc: In function ‘void
noncopyable(stream_mutex<std::basic_ostream<char> >&)’:
../testing/stream_mutex_test.cc:30:5: error: ‘NonCopyable::NonCopyable(const
NonCopyable&)’ is private
../testing/stream_mutex_test.cc:41:16: error: within this context
../include/stream_mutex.h:97:22: error: initializing argument 2 of
‘stream_guard<Stream> operator<<(stream_mutex<Stream>&, T) [with Stream =
std::basic_ostream<char>, T = NonCopyable]’
make[1]: *** [stream_mutex_test.o] Error 1
Note if I comment out lines 38-42, compilation succeeds (for the std::ostream
version of noncopyable).
Original issue reported on code.google.com by [email protected]
on 15 May 2013 at 12:28
I failed to make the code compile with gcc-4.4. It fails with:
$ make test
[...]
g++-4.4 test_mutex_test.o condition_variable_test.o lock_test.o race_test.o
concurrent_priority_queue_test.o blockable_thread.o
blocking_queue_closed_test.o test_mutex.o gtest-all.o gmock-all.o gmock_main.o
lower.a stdfake.a -pthread -std=c++0x -o mutex_test.exe
sh ../util/exetest.sh mutex_test
g++-4.4 blocking_queue_test.o source_test.o iterator_queue_test.o
stream_mutex_test.o buffer_queue_test.o gtest-all.o gmock-all.o gmock_main.o
lower.a stdfake.a -pthread -std=c++0x -o higher_test.exe
buffer_queue_test.o:(.rodata._ZTCN3gcl12buffer_queueIiEE0_NS_10queue_backIiEE[vt
able for gcl::buffer_queue<int>]+0x60): undefined reference to
`gcl::queue_back<int>::~queue_back()'
buffer_queue_test.o:(.rodata._ZTCN3gcl12buffer_queueIiEE0_NS_10queue_backIiEE[vt
able for gcl::buffer_queue<int>]+0x68): undefined reference to
`gcl::queue_back<int>::~queue_back()'
buffer_queue_test.o:(.rodata._ZTCN3gcl12buffer_queueIiEE0_NS_10queue_backIiEE[vt
able for gcl::buffer_queue<int>]+0xe0): undefined reference to `virtual thunk
to gcl::queue_back<int>::~queue_back()'
buffer_queue_test.o:(.rodata._ZTCN3gcl12buffer_queueIiEE0_NS_10queue_backIiEE[vt
able for gcl::buffer_queue<int>]+0xe8): undefined reference to `virtual thunk
to gcl::queue_back<int>::~queue_back()'
buffer_queue_test.o:(.rodata._ZTCN3gcl12buffer_queueIiEE208_NS_11queue_frontIiEE
[vtable for gcl::buffer_queue<int>]+0x60): undefined reference to
`gcl::queue_front<int>::~queue_front()'
buffer_queue_test.o:(.rodata._ZTCN3gcl12buffer_queueIiEE208_NS_11queue_frontIiEE
[vtable for gcl::buffer_queue<int>]+0x68): undefined reference to
`gcl::queue_front<int>::~queue_front()'
buffer_queue_test.o:(.rodata._ZTCN3gcl10queue_baseIiEE0_NS_10queue_backIiEE[vtab
le for gcl::queue_base<int>]+0x60): undefined reference to
`gcl::queue_back<int>::~queue_back()'
buffer_queue_test.o:(.rodata._ZTCN3gcl10queue_baseIiEE0_NS_10queue_backIiEE[vtab
le for gcl::queue_base<int>]+0x68): undefined reference to
`gcl::queue_back<int>::~queue_back()'
buffer_queue_test.o:(.rodata._ZTCN3gcl10queue_baseIiEE0_NS_10queue_backIiEE[vtab
le for gcl::queue_base<int>]+0xe0): undefined reference to `virtual thunk to
gcl::queue_back<int>::~queue_back()'
buffer_queue_test.o:(.rodata._ZTCN3gcl10queue_baseIiEE0_NS_10queue_backIiEE[vtab
le for gcl::queue_base<int>]+0xe8): undefined reference to `virtual thunk to
gcl::queue_back<int>::~queue_back()'
buffer_queue_test.o:(.rodata._ZTCN3gcl10queue_baseIiEE8_NS_11queue_frontIiEE[vta
ble for gcl::queue_base<int>]+0x60): undefined reference to
`gcl::queue_front<int>::~queue_front()'
buffer_queue_test.o:(.rodata._ZTCN3gcl10queue_baseIiEE8_NS_11queue_frontIiEE[vta
ble for gcl::queue_base<int>]+0x68): undefined reference to
`gcl::queue_front<int>::~queue_front()'
buffer_queue_test.o:(.rodata._ZTVN3gcl12queue_commonIiEE[vtable for
gcl::queue_common<int>]+0x30): undefined reference to
`gcl::queue_common<int>::~queue_common()'
buffer_queue_test.o:(.rodata._ZTVN3gcl12queue_commonIiEE[vtable for
gcl::queue_common<int>]+0x38): undefined reference to
`gcl::queue_common<int>::~queue_common()'
collect2: ld returned 1 exit status
make[1]: *** [higher_test.exe] Error 1
make[1]: *** Waiting for unfinished jobs....
Original issue reported on code.google.com by mathieu.malaterre
on 24 Jul 2012 at 9:16
In the current implementation of countdown_latch::wait()
in src/countdown_latch.cc
void countdown_latch::wait() {
unique_lock<mutex> lock(condition_mutex_);
while(count_ > 0) {
condition_.wait(lock);
}
}
I think the while loop is redundant as the thread
has already blocked when count_ > 0 due to the statement
condition_.wait(lock);
I suggest to replace while by if as follows
void countdown_latch::wait() {
unique_lock<mutex> lock(condition_mutex_);
if(count_ > 0) {
condition_.wait(lock);
}
}
Original issue reported on code.google.com by [email protected]
on 8 Jan 2015 at 6:36
The output when I tried to build:
$ make
cd dbg98 ; make -j 2 -f ../util/Makefile generate BFLAGS=-g3
CXXFLAGS="-std=c++98 -Wno-c++0x-compat"
make[1]: Entering directory
`/home/guanyu/Programs/MapReduce/gcl/google-concurrency-library/dbg98'
make[1]: Nothing to be done for `generate'.
make[1]: Leaving directory
`/home/guanyu/Programs/MapReduce/gcl/google-concurrency-library/dbg98'
cd dbg98 ; make -j 2 -f ../util/Makefile test BFLAGS=-g3 CXXFLAGS="-std=c++98
-Wno-c++0x-compat"
make[1]: Entering directory
`/home/guanyu/Programs/MapReduce/gcl/google-concurrency-library/dbg98'
sh ../util/exetest.sh dynarray_test
sh ../util/exetest.sh atomic_c_test
sh ../util/exetest.sh atomic_cpp_test
g++ -MMD -MP -Wall -Werror -Wno-error=c++0x-compat -I. -I../include -g3
-std=c++98 -Wno-c++0x-compat ../testing/counter_test.cc -c -o counter_test.o
g++ -MMD -MP -Wall -Werror -Wno-error=c++0x-compat -I. -I../include -g3
-std=c++98 -Wno-c++0x-compat -I../third_party/googletest/include
-I../third_party/googletest -I../third_party/googlemock/include
-I../third_party/googlemock ../third_party/googlemock/src/gmock-all.cc -c -o
gmock-all.o
In file included from ../testing/counter_test.cc:18:0:
../include/counter.h: In instantiation of ‘void
gcl::counter::strong_duplex<Integral>::erase(gcl::counter::strong_duplex<Integra
l>::broker_type*, Integral) [with Integral = int;
gcl::counter::strong_duplex<Integral>::broker_type =
gcl::counter::strong_broker<int>]’:
../include/counter.h:622:5: required from
‘gcl::counter::strong_broker<Integral>::~strong_broker() [with Integral =
int]’
../testing/counter_test.cc:105:12: required from here
../include/counter.h:570:5: error: ‘operator+=’ was not declared in this
scope, and no declarations were found by argument-dependent lookup at the point
of instantiation [-fpermissive]
../include/counter.h:570:5: note: declarations in dependent base
‘gcl::counter::bumper<int, (gcl::counter::atomicity)2u>’ are not found by
unqualified lookup
../include/counter.h:570:5: note: use ‘this->operator+=’ instead
../include/counter.h: In instantiation of ‘void
gcl::counter::weak_duplex<Integral>::erase(gcl::counter::weak_duplex<Integral>::
broker_type*, Integral) [with Integral = int;
gcl::counter::weak_duplex<Integral>::broker_type =
gcl::counter::weak_broker<int>]’:
../include/counter.h:714:5: required from
‘gcl::counter::weak_broker<Integral>::~weak_broker() [with Integral = int]’
../testing/counter_test.cc:115:12: required from here
../include/counter.h:676:5: error: ‘operator+=’ was not declared in this
scope, and no declarations were found by argument-dependent lookup at the point
of instantiation [-fpermissive]
../include/counter.h:676:5: note: declarations in dependent base
‘gcl::counter::bumper<int, (gcl::counter::atomicity)2u>’ are not found by
unqualified lookup
../include/counter.h:676:5: note: use ‘this->operator+=’ instead
make[1]: *** [counter_test.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory
`/home/guanyu/Programs/MapReduce/gcl/google-concurrency-library/dbg98'
make: *** [test_dbg98] Error 2
Original issue reported on code.google.com by [email protected]
on 5 Aug 2013 at 6:11
[email protected] via googlegroups.com
Dec 11 (1 day ago)
to google-concurr.
Hi,
I just tried to compile the library on a current Ubuntu which ships g++-4.8.1.
Since the code of gmock contains unused typedefs and g++ 4.8 warns about them
and you are using the -Werror flag in the google-concurrency-library Makefiles
the build fails.
Removing the -Werror temporarily is a good workaround but eventually the
problem should be fixed upstream, I guess.
Cheers,
Manuel
Original issue reported on code.google.com by alasdair.mackintosh
on 13 Dec 2013 at 12:22
I failed to compile the code using gcc-4.7. It fails with:
$ make
[...]
g++ -MMD -MP -Wall -Werror -I. -I../include -g3 -std=c++98
../testing/counter_test.cc -c -o counter_test.o
In file included from ../testing/cxx0x_test.cc:15:0:
../include/cxx0x.h:174:1: error: identifier 'nullptr' is a keyword in C++11
[-Werror=c++0x-compat]
cc1plus: all warnings being treated as errors
make[1]: *** [cxx0x_test.o] Error 1
make[1]: *** Waiting for unfinished jobs....
In file included from ./atomic.h:16:0,
from ../testing/atomic_cpp_test.cc:15:
../include/cxx0x.h:174:1: error: identifier 'nullptr' is a keyword in C++11
[-Werror=c++0x-compat]
cc1plus: all warnings being treated as errors
make[1]: *** [atomic_cpp_test.o] Error 1
In file included from ./atomic.h:16:0,
from ../include/counter.h:17,
from ../testing/counter_test.cc:17:
../include/cxx0x.h:174:1: error: identifier 'nullptr' is a keyword in C++11
[-Werror=c++0x-compat]
cc1plus: all warnings being treated as errors
make[1]: *** [counter_test.o] Error 1
Original issue reported on code.google.com by mathieu.malaterre
on 24 Jul 2012 at 9:16
Please verify the change at:
http://code.google.com/p/google-concurrency-library/source/diff?spec=svnaa4a5e36
04d0e19066bba856e0a09fcdb374e2c6&r=aa4a5e3604d0e19066bba856e0a09fcdb374e2c6&form
at=side&path=/include/cxx0x.h
Original issue reported on code.google.com by alasdair.mackintosh
on 21 Mar 2011 at 12:36
What steps will reproduce the problem?
1. opt0x/pipeline_test.exe --gtest_filter=PipelineTest.ParallelExample
What is the expected output? What do you see instead?
a system error exception is threw and failed to pass the unit test.
What version of the product are you using? On what operating system?
I use the latest source code (Rev dca96397046b) on CentOS 6 with kernel 2.6.32
and gcc 4.4.6.
Please provide any additional information below.
$ gdb opt0x/pipeline_test.exe
(gdb) r --gtest_filter=PipelineTest.ParallelExample
Starting program: opt0x/pipeline_test.exe
--gtest_filter=PipelineTest.ParallelExample
[Thread debugging using libthread_db enabled]
Running main() from gmock_main.cc
Note: Google Test filter = PipelineTest.ParallelExample
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from PipelineTest
[ RUN ] PipelineTest.ParallelExample
[New Thread 0x7ffff7fe4700 (LWP 29897)]
[New Thread 0x7ffff75e3700 (LWP 29898)]
find_uid for Queued Hello
get for 12
Consuming (User : 12)
find_uid for queued world
get for 12
Consuming (User : 12)
find_uid for queued 1
get for 8
Consuming (User : 8)
find_uid for queued 22
get for 9
Consuming (User : 9)
find_uid for queued 333
get for 10
Consuming (User : 10)
find_uid for queued 4444
get for 11
Consuming (User : 11)
find_uid for queued 55555
get for 12
Consuming (User : 12)
find_uid for queued 666666
get for 13
Consuming (User : 13)
find_uid for More stuff
get for 10
Consuming (User : 10)
find_uid for Yet More stuff
get for 14
Consuming (User : 14)
find_uid for Are we done yet???
get for 18
Consuming (User : 18)
terminate called after throwing an instance of 'std::system_error'
what():
Program received signal SIGABRT, Aborted.
0x0000003a45e32885 in raise () from /lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.47.el6.x86_64
libgcc-4.4.6-3.el6.x86_64 libstdc++-4.4.6-3.el6.x86_64
(gdb) bt
#0 0x0000003a45e32885 in raise () from /lib64/libc.so.6
#1 0x0000003a45e34065 in abort () from /lib64/libc.so.6
#2 0x0000003a522bea7d in __gnu_cxx::__verbose_terminate_handler() () from
/usr/lib64/libstdc++.so.6
#3 0x0000003a522bcc06 in ?? () from /usr/lib64/libstdc++.so.6
#4 0x0000003a522bcc33 in std::terminate() () from /usr/lib64/libstdc++.so.6
#5 0x0000003a522bcd2e in __cxa_throw () from /usr/lib64/libstdc++.so.6
#6 0x0000000000433134 in MutexInternal::_posix_mutex::~_posix_mutex() ()
#7 0x0000000000430f15 in gcl::barrier::~barrier() ()
#8 0x00000000004056f6 in gcl::PipelineExecution::~PipelineExecution() ()
#9 0x0000000000407d42 in PipelineTest_ParallelExample_Test::TestBody() ()
#10 0x0000000000423b9b in testing::Test::Run() ()
#11 0x0000000000423dc2 in testing::internal::TestInfoImpl::Run() ()
#12 0x0000000000423ef0 in testing::TestCase::Run() ()
#13 0x0000000000424623 in testing::internal::UnitTestImpl::RunAllTests() ()
#14 0x00000000004300fa in main ()
Original issue reported on code.google.com by [email protected]
on 25 Jan 2012 at 7:51
What steps will reproduce the problem?
1. make include/atomic.h
What is the expected output? What do you see instead?
Expected output is:
/bin/bash util/atomic.sh > include/atomic.h
Experienced output is:
/bin/sh util/atomic.sh > include/atomic.h
util/atomic.sh: 665: Bad substitution
make: *** [include/atomic.h] Error 2
What version of the product are you using? On what operating system?
changset 48:67210bc745d8 running on Ubuntu 10.10
Please provide any additional information below.
Modifying the commands for target include/atomic.h to:
Original issue reported on code.google.com by [email protected]
on 24 Nov 2010 at 10:16
Hi,
I am not very clear about how MMD and MF works .When I met below problem,
I am very puzzled whey the dependency file is expected here.
Can anybody help me?
Thanks in advanced!
BTW, the directory of /vob/mds_hlr_retrofit/obj/x86/rh5/ does exist.
/mCAS/tools/xgcc-4.4.6-3_x86_64/usr/bin/x86_64-redhat-linux-g++ -B
/mCAS/tools/xgcc-4.4.6-3_x86_64/usr/lib64 -B
/mCAS/tools/xgcc-4.4.6-3_x86_64/lib64 -B
/mCAS/tools/xgcc-4.4.6-3_x86_64/usr/libexec/gcc/x86_64-redhat-linux/4.4.6 -L
/mCAS/sdk/SU4R30BP.052214/cc/vendor_linux/Apache/lib64/LX -L
/mCAS/tools/xgcc-4.4.6-3_x86_64/usr/lib64 -B
/mCAS/tools/xgcc-4.4.6-3_x86_64/usr/bin -DNO_TOMAS -g -o2 -DLIB -fPIC -pthread
-fpermissive -I/vob/mds_common/include/custom
-I/vob/mds_hlr_retrofit/src/tools/GdmiPython/Src/../Inc
-I/vob/mds_hlr_retrofit/src/tools/GdmiPython/Src/../Lds
-I/vob/3pp_catalog/src/msg/Inc -I/vob/fwk_deliv/include -I/vob/sdm_mcas
-I/vob/mds_hlr_retrofit/src/tools/GdmiPython/Inc -I/vob/fwk_deliv/include/
-I/vob/fwk_deliv/include/System/Gdmi -I/mCAS/tools/rhel6.2/include/python2.6
-I/mCAS/tools/rhel6.2/include -I/mCAS/tools/xgcc-4.4.6-3_x86_64/usr/include
-I/mCAS/tools/xgcc-4.4.6-3_x86_64/usr/include/c++/4.4.6
-I/mCAS/tools/xgcc-4.4.6-3_x86_64/usr/include/c++/4.4.6/x86_64-redhat-linux
-I/mCAS/tools/xgcc-4.4.6-3_x86_64/usr/lib/gcc/x86_64-redhat-linux/4.4.6/include
-c -MMD -MF /vob/mds_hlr_retrofit/obj/x86/rh5/Util.d -c
/vob/mds_hlr_retrofit/src/tools/GdmiPython/Src/Util.cc -o
/vob/mds_hlr_retrofit/obj/x86/rh5/Util.o
Live child 0x1ee64780 (/vob/mds_hlr_retrofit/obj/x86/rh5/Util.o) PID 18296
cc1plus: error: /vob/mds_hlr_retrofit/obj/x86/rh5/Util.d: No such file or
directory
Reaping losing child 0x1ee64780 PID 18296
make: *** [/vob/mds_hlr_retrofit/obj/x86/rh5/Util.o] Error 1
Removing child 0x1ee64780 PID 18296 from chain.
Original issue reported on code.google.com by [email protected]
on 16 Jun 2014 at 3:18
What steps will reproduce the problem?
1. make include/atomic.h
What is the expected output? What do you see instead?
Expected output is:
/bin/bash util/atomic.sh > include/atomic.h
Experienced output is:
/bin/sh util/atomic.sh > include/atomic.h
util/atomic.sh: 665: Bad substitution
make: *** [include/atomic.h] Error 2
What version of the product are you using? On what operating system?
changset 48:67210bc745d8 running on Ubuntu 10.10
Please provide any additional information below.
Modifying the commands for target include/atomic.h to:
- sh util/atomic.sh > include/atomic.h
+ $(SHELL) util/atomic.sh > include/atomic.h
and then running the following works:
make include/atomic.h SHELL=/bin/bash
Original issue reported on code.google.com by [email protected]
on 24 Nov 2010 at 10:19
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.