Recent Posts

Pages: 1 ... 7 8 [9] 10
81
General Discussion about just::thread / Need on help on hardware_concurrency
« Last post by will on October 19, 2011, 03:47:34 PM »
Hi Can anyone help me with the following code snippet testing hardware_concurrency.

will@localhost:~/testspace/thread$ cat testHardware.cpp
#include <iostream>
#include <thread>
using namespace std;
int main() {
  cerr << "Hardware concurrency: " << std::thread::hardware_concurrency() << endl;
  return 0;
}
will@localhost:~/testspace/thread$ g++ -O2 -o hardware testHardware.cpp -I/usr/include/justthread -L/usr/lib64/ -ljustthread -pthread
/usr/lib64//libjustthread.a(chrono.o): In function `std::__jssZ46::chrono::(anonymous namespace)::get_monotonic_nanoseconds()':
chrono.cpp:(.text+0x1e): undefined reference to `clock_gettime'
/usr/lib64//libjustthread.a(chrono.o): In function `std::__jssZ46::chrono::system_clock::now()':
chrono.cpp:(.text+0x5b): undefined reference to `clock_gettime'
/usr/lib64//libjustthread.a(chrono.o): In function `std::__jssZ46::this_thread::__sleep_until(std::__jssZ46::chrono::time_point<std::__jssZ46::chrono::system_clock, std::__jssZ46::chrono::duration<long long, std::__jssZ46::ratio<1ll, 1000000000ll> > > const&)':
chrono.cpp:(.text+0x1bd): undefined reference to `clock_nanosleep'
/usr/lib64//libjustthread.a(chrono.o): In function `std::__jssZ46::this_thread::__sleep_until(std::__jssZ46::chrono::time_point<std::__jssZ46::chrono::monotonic_clock, std::__jssZ46::chrono::duration<long long, std::__jssZ46::ratio<1ll, 1000000000ll> > > const&)':
chrono.cpp:(.text+0x220): undefined reference to `clock_nanosleep'
collect2: ld returned 1 exit status
82
General Discussion about just::thread / ANNOUNCE: Just::Thread 1.7.0 released
« Last post by Anthony Williams on October 10, 2011, 12:40:00 PM »
I am pleased to announce that version 1.7.0 of Just::Thread has been released.

This release adds official support for gcc v4.4 on Centos 6, so Just::Thread is now supported on Centos, Fedora, Ubuntu and Debian Linux distributions, as well as Microsoft Windows and Apple MacOSX.

The main change with this release is an enhancement to the std::async implementation. With this enhanced scheduler, the default launch policy (std::launch::async | std::launch::deferred) will defer forcing a decision until either enough resources become available to schedule the task as std::launch::async, or the task is forced to be scheduled as std::launch:deferred by a call to a waiting function (get(), wait(), wait_for() or wait_until()). This will allow more tasks to be scheduled as std::launch::async overall, and allow your application to make better use of the available hardware concurrency.

The implementation of recursive mutexes has been overhauled, leading to much faster lock and unlock times than in previous releases.

This release also provides debugger visualizers for Microsoft Visual Studio, to better show the state of Just::Thread objects such as futures. This will provide greater insight into the state of your program, and allow easier debugging.

As usual, existing customers are entitled to a free upgrade to V1.7.0 from all earlier versions.
83
General Discussion about just::thread / Re: #define _AMD64_
« Last post by Anthony Williams on October 10, 2011, 12:30:59 PM »
Thanks for the report; this fix will be in the next release.
84
General Discussion about just::thread / #define _AMD64_
« Last post by Rich Hornay on October 10, 2011, 12:24:28 PM »
I am getting the following (VS2010, v90 toolset):

1>F:\ThirdParty\just_thread\1.7\include\jss/atomic_impl.hpp(16): error C2220: warning treated as error - no 'object' file generated
1>F:\ThirdParty\just_thread\1.7\include\jss/atomic_impl.hpp(16): warning C4005: '_AMD64_' : macro redefinition
1>          command-line arguments :  see previous definition of '_AMD64_'

I get around it via #undef _AMD64_ before including <atomic>, but I would prefer not to do that.  Maybe you should consider #ifndef _AMD64_ before defining it?  The value is somewhat erratic.  I have found it defined empty and 1.
85
I think I figured it out. I'm not sure exactly what I did, but it works. I'm going to try to replicate it on my laptop now and figure out what minimally has to be done. I know I had to do some pretty extravagant things and I'd like to see if I can simplify.

Thanks for the help!!!
86
Sorry about the problem you encountered with uploading an attachment.

With regards to your problem, it should just be a matter of doing a Clean from the Build menu in XCode. For some reason, XCode had built an x86_64 object file from main.cpp, but wasn't rebuilding it for i386.

If you are still having problems, let me know.
87
I tried a couple times to post the attachment and was met with an "Internal Server Error". Doh!

I've uploaded it to my website http://www.migrap.com/tmp/Threads.zip
88
It does seem like the linker is trying to link an x86_64 binary. Can you post a sample project that demonstrates the problem?
89
General Discussion about just::thread / Unable to link on Snow Leopard (Xcode 3.2.6)
« Last post by migrap on August 23, 2011, 03:38:17 PM »
When I attempt to link justthread-mp-4.5.a I get the following error "file was built for unsupported file format which is not the architecture being linked (x86_64)".

I've removed the "x86_64" from the list of valid architectures and I'm only trying to build against the 32-bit Intel architecture.

Xcode's build command starts with "g++-4.5 -arch i386 -isysroot" and then is followed by paths to headers, sources, etc. So things appear to be right.

What am I missing?
90
I am pleased to announce that version 1.6.1 of just::thread has been released.

Changes include:
  • Updated API to conform to the Final C++0x Standard draft
  • Support for gcc 4.6 on Ubuntu Natty (using the packages from the Ubuntu Toolchain PPA), Fedora 15 and MacOSX.
  • Support for thread-local variables with non-trivial constructors and destructors using the JSS_THREAD_LOCAL macro in place of the new thread_local keyword (which is not supported in any current compilers) .
  • The std::hash<std::thread::id> specialization has been added.
  • The new constexpr and noexcept keywords are used where supported (gcc 4.6 in -std=c++0x mode.)
  • The return type of lambda functions is correctly deduced in std::async in both gcc 4.5 and 4.6 and MSVC 2010.
  • Various optimizations, including reduction in thread creation code and the overhead of std::async.
  • Added std::chrono::system_clock::from_time_t in place of std::chrono::system_clock::to_time_point.
As usual, existing customers are entitled to a free upgrade to V1.6.1 from all earlier versions.
Pages: 1 ... 7 8 [9] 10