
I decided to give the lockfree library that's currently in the review queue a try. On MSVC 9.0, I'm getting this error: boost\lockfree\detail\cas.hpp(129) : error C2440: 'reinterpret_cast' : cannot convert from 'const boost::uint64_t' to 'LONGLONG' The compiler then continues to say: Conversion is a valid standard conversion, which can be performed implicitly or by use of static_cast, C-style cast or function-style cast Am I missing a configuration macro, or is this a valid compile error? Emil Dotchevski Reverge Studios, Inc. http://www.revergestudios.com/reblog/index.php?n=ReCode

hello emil,
I decided to give the lockfree library that's currently in the review queue a try. On MSVC 9.0, I'm getting this error:
boost\lockfree\detail\cas.hpp(129) : error C2440: 'reinterpret_cast' : cannot convert from 'const boost::uint64_t' to 'LONGLONG'
The compiler then continues to say:
Conversion is a valid standard conversion, which can be performed implicitly or by use of static_cast, C-style cast or function-style cast
Am I missing a configuration macro, or is this a valid compile error?
i ported boost.lockfree to boost.atomic. the archive in the vault doesn't reflect this change yet, but you can check out my latest sources from my git repository [1,2]. the specific code, that triggered that error message has been replaced by boost.atomic ... cheers, tim [1] http://tim.klingt.org/git?p=boost_lockfree.git;a=summary [2] git://tim.klingt.org/boost_lockfree.git -- tim@klingt.org http://tim.klingt.org The only people for me are the mad ones, the ones who are mad to live, mad to talk, mad to be saved, desirous of everything at the same time, the ones who never yawn or say a commonplace thing, but burn, burn, burn, like fabulous yellow roman candles exploding like spiders across the stars and in the middle you see the blue centerlight pop and everybody goes "Awww! Jack Kerouac

On Sun, Feb 28, 2010 at 2:08 AM, Tim Blechmann <tim@klingt.org> wrote:
hello emil,
i ported boost.lockfree to boost.atomic. the archive in the vault doesn't reflect this change yet, but you can check out my latest sources from my git repository [1,2]. the specific code, that triggered that error message has been replaced by boost.atomic ...
I get more problems with the code I downloaded from the git link you posted on MSVC 9.0. I'm including the complete log at the end of this message, the issue seems to be that it can't access the size_t typedef from the base class because it is private. Changing the ringbuffer functions to use std::size_t fixes the errors. So what is the status of lockfree? What compilers is it tested with? Can I rely on ringbuffer working now that I've got it to compile? Emil Dotchevski Reverge Studios, Inc. http://www.revergestudios.com/reblog/index.php?n=ReCode ---- z:\code\lib\lockfree\boost\atomic.hpp(167) : warning C4800: 'intptr_t' : forcing value to bool 'true' or 'false' (performance warning) z:\code\lib\lockfree\boost\lockfree\ringbuffer.hpp(216) : error C2248: 'boost::lockfree::detail::ringbuffer_internal<T>::size_t' : cannot access private typedef declared in class 'boost::lockfree::detail::ringbuffer_internal<T>' with [ T=boost::shared_ptr<const re::sfx::sound> ] z:\code\lib\lockfree\boost\lockfree\ringbuffer.hpp(39) : see declaration of 'boost::lockfree::detail::ringbuffer_internal<T>::size_t' with [ T=boost::shared_ptr<const re::sfx::sound> ] z:\code\dev\reverge\sfx\sfx-windows.cpp(408) : see reference to class template instantiation 'boost::lockfree::ringbuffer<T,max_size>' being compiled with [ T=boost::shared_ptr<const re::sfx::sound>, max_size=64 ] z:\code\lib\lockfree\boost\lockfree\ringbuffer.hpp(217) : error C2248: 'boost::lockfree::detail::ringbuffer_internal<T>::size_t' : cannot access private typedef declared in class 'boost::lockfree::detail::ringbuffer_internal<T>' with [ T=boost::shared_ptr<const re::sfx::sound> ] z:\code\lib\lockfree\boost\lockfree\ringbuffer.hpp(39) : see declaration of 'boost::lockfree::detail::ringbuffer_internal<T>::size_t' with [ T=boost::shared_ptr<const re::sfx::sound> ] z:\code\lib\lockfree\boost\lockfree\ringbuffer.hpp(221) : error C2248: 'boost::lockfree::detail::ringbuffer_internal<T>::size_t' : cannot access private typedef declared in class 'boost::lockfree::detail::ringbuffer_internal<T>' with [ T=boost::shared_ptr<const re::sfx::sound> ] z:\code\lib\lockfree\boost\lockfree\ringbuffer.hpp(39) : see declaration of 'boost::lockfree::detail::ringbuffer_internal<T>::size_t' with [ T=boost::shared_ptr<const re::sfx::sound> ] z:\code\lib\lockfree\boost\lockfree\ringbuffer.hpp(222) : error C2248: 'boost::lockfree::detail::ringbuffer_internal<T>::size_t' : cannot access private typedef declared in class 'boost::lockfree::detail::ringbuffer_internal<T>' with [ T=boost::shared_ptr<const re::sfx::sound> ] z:\code\lib\lockfree\boost\lockfree\ringbuffer.hpp(39) : see declaration of 'boost::lockfree::detail::ringbuffer_internal<T>::size_t' with [ T=boost::shared_ptr<const re::sfx::sound> ]

sry for my late reply,
i ported boost.lockfree to boost.atomic. the archive in the vault doesn't reflect this change yet, but you can check out my latest sources from my git repository [1,2]. the specific code, that triggered that error message has been replaced by boost.atomic ...
I get more problems with the code I downloaded from the git link you posted on MSVC 9.0. I'm including the complete log at the end of this message, the issue seems to be that it can't access the size_t typedef from the base class because it is private. Changing the ringbuffer functions to use std::size_t fixes the errors.
thanks for reporting, i've commited a fix
So what is the status of lockfree?
well, i am using it successfully in a couple of projects and it passes the stress tests on the machines, that i can access (x86-64, core2, core i7). it is scheduled for review and i consider the implementation as stable ...
What compilers is it tested with?
linux, gcc-4.2, 4.3, 4.4 i don't have access to other compilers, so i need to rely on other people's report
Can I rely on ringbuffer working now that I've got it to compile?
the ringbuffer algorithm is used in several different project, so if i got the implementation right, you can to rely on it ... but you can run some stress tests to test it yourself ... just note, that it is a single- producer/single-consumer implementation! cheers, tim -- tim@klingt.org http://tim.klingt.org Bill Gates left his university to start Micro$oft. Steve Jobs sold his Wolkswagen bus to start Apple. Linus Torvalds made a new thread in a forum and put a file on a ftp server.

i don't have access to other compilers, so i need to rely on other people's report
Hello Tim, MSVC 9.0 complains about lockfree/fifo - does not like tagged_ptr to have copy constructor: 1>e:\work\201003\10.lock_free\boost-lf\boost\atomic\detail\integral-casts.hpp(228) : error C2621: member 'boost::detail::atomic::platform_atomic<T>::e' of union 'boost::detail::atomic::platform_atomic<T>::<unnamed-tag>' has copy constructor 1> with 1> [ 1> T=boost::lockfree::tagged_ptr<boost::lockfree::detail::fifo<EU_DATA,boost::lockfree::caching_freelist_t,std::allocator<EU_DATA>>::node> 1> ] 1> e:\work\201003\10.lock_free\boost-lf\boost\atomic\detail\base.hpp(63) : see reference to class template instantiation 'boost::detail::atomic::platform_atomic<T>' being compiled 1> with 1> [ 1> T=boost::lockfree::tagged_ptr<boost::lockfree::detail::fifo<EU_DATA,boost::lockfree::caching_freelist_t,std::allocator<EU_DATA>>::node> 1> ] 1> e:\work\201003\10.lock_free\boost-lf\boost\atomic.hpp(20) : see reference to class template instantiation 'boost::detail::atomic::internal_atomic<T>' being compiled 1> with 1> [ 1> T=boost::lockfree::tagged_ptr<boost::lockfree::detail::fifo<EU_DATA,boost::lockfree::caching_freelist_t,std::allocator<EU_DATA>>::node> 1> ] 1> e:\work\201003\10.lock_free\boost-lf\boost\lockfree\fifo.hpp(202) : see reference to class template instantiation 'boost::atomic<T>' being compiled 1> with 1> [ 1> T=boost::lockfree::tagged_ptr<boost::lockfree::detail::fifo<EU_DATA,boost::lockfree::caching_freelist_t,std::allocator<EU_DATA>>::node> 1> ] Though, after commening copy contructor, there is another error: 1>e:\work\201003\10.lock_free\boost-lf\boost\atomic\detail\integral-casts.hpp(228) : error C2620: member 'boost::detail::atomic::platform_atomic<T>::e' of union 'boost::detail::atomic::platform_atomic<T>::<unnamed-tag>' has user-defined constructor or non-trivial default constructor 1> with 1> [ 1> T=boost::lockfree::tagged_ptr<boost::lockfree::detail::fifo<EU_DATA,boost::lockfree::caching_freelist_t,std::allocator<EU_DATA>>::node> 1> ] 1> e:\work\201003\10.lock_free\boost-lf\boost\atomic\detail\base.hpp(63) : see reference to class template instantiation 'boost::detail::atomic::platform_atomic<T>' being compiled 1> with 1> [ 1> T=boost::lockfree::tagged_ptr<boost::lockfree::detail::fifo<EU_DATA,boost::lockfree::caching_freelist_t,std::allocator<EU_DATA>>::node> 1> ] 1> e:\work\201003\10.lock_free\boost-lf\boost\atomic.hpp(20) : see reference to class template instantiation 'boost::detail::atomic::internal_atomic<T>' being compiled 1> with 1> [ 1> T=boost::lockfree::tagged_ptr<boost::lockfree::detail::fifo<EU_DATA,boost::lockfree::caching_freelist_t,std::allocator<EU_DATA>>::node> 1> ] 1> e:\work\201003\10.lock_free\boost-lf\boost\lockfree\fifo.hpp(202) : see reference to class template instantiation 'boost::atomic<T>' being compiled 1> with 1> [ 1> T=boost::lockfree::tagged_ptr<boost::lockfree::detail::fifo<EU_DATA,boost::lockfree::caching_freelist_t,std::allocator<EU_DATA>>::node> 1> ] Thanks, Andrey _________________________________________________________________ Hotmail: Free, trusted and rich email service. http://clk.atdmt.com/GBL/go/201469228/direct/01/

[apparently my response got lost]
i don't have access to other compilers, so i need to rely on other people's report
Hello Tim,
MSVC 9.0 complains about lockfree/fifo - does not like tagged_ptr to have copy constructor:
it actually complaints about boost.atomic, which uses some unions in its fallback code ... so helge would have to adapt the atomic library for msvc to make lockfree work ... tim -- tim@klingt.org http://tim.klingt.org Only very good and very bad programmers use goto in C
participants (4)
-
Andrey Zhdanov
-
Emil Dotchevski
-
Emil Dotchevski
-
Tim Blechmann