Recent Posts

Pages: 1 ... 4 5 [6] 7 8 ... 10
51
General Discussion about just::thread / Re: Lambda functions
« Last post by Anthony Williams on July 27, 2012, 08:30:04 AM »
Yes, if your compiler supports lambda functions (e.g. MSVC2010, g++ 4.6) then you can use them with the library. e.g.

Code: [Select]
std::thread t(
    []{
        do_something();
        do_something_else();
    });
52
General Discussion about just::thread / Lambda functions
« Last post by kkerbel on July 27, 2012, 07:14:06 AM »
Are they possible with this library?  Thanks.
53
General Discussion about just::thread / Re: managed C++ crash
« Last post by nbsystems on May 10, 2012, 11:34:52 PM »
Thanks for looking into it!
54
General Discussion about just::thread / Re: managed C++ crash
« Last post by Anthony Williams on May 08, 2012, 12:59:21 PM »
Possibly. I'll look into the implementation changes that would be required.
55
General Discussion about just::thread / Re: mutex - owning thread?
« Last post by Anthony Williams on May 08, 2012, 12:58:15 PM »
No, there isn't. The normal build of the library does not track this information. The checked build does, but this is not available outside the deadlock-detection code. For one thing, it could change between the call being made and the information being used.
56
General Discussion about just::thread / mutex - owning thread?
« Last post by Rich Hornay on May 08, 2012, 12:44:45 PM »
Is there a way to find the owning thread of a std::mutex?  It would be desirable to see this both live and especially in crash dumps.
57
General Discussion about just::thread / Re: managed C++ crash
« Last post by nbsystems on May 08, 2012, 01:09:52 AM »
We've been researching this issue further, hoping to find a workaround. We've found that the Boost thread library uses TLS callbacks for similar purposes. However, in Boost::thread it's possible to disable the TLS-callback-based automatic cleanup and free thread-specific resources manually instead (although documentation of this option is scant). This would presumably allow the library to be used in a mixed-mode DLL.

Is there a chance that such an option could be implemented within Just::Thread? We would prefer not to switch to the Boost thread library if possible.
58
General Discussion about just::thread / Re: managed C++ crash
« Last post by Anthony Williams on January 24, 2012, 08:42:24 AM »
The restriction is that a mixed-mode or managed DLL cannot contain TLS callbacks.

Just::Thread uses TLS callbacks to ensure that the process-wide and thread-specific data it uses is correctly constructed and destroyed, so it cannot be used in a mixed-mode DLL.

Note that this is about the DLL itself, not the process: Just::Thread can be used in a native DLL called from managed code without problems, as you have discovered.
59
General Discussion about just::thread / Re: managed C++ crash
« Last post by nbsystems on January 23, 2012, 11:16:39 PM »
Thanks for the reply.

What exactly is the restriction?
The current setup of this application is a managed application which loads and uses a native COM dll. Just::Thread is used by the native COM dll and that works fine.
We would like to add some managed code to this dll, but the code using your library would still be entirely native. What is it exactly that happens during the module load process that causes this crash?
60
General Discussion about just::thread / Re: managed C++ crash
« Last post by Anthony Williams on January 23, 2012, 09:27:00 PM »
Just::Thread does not work with managed or mixed-mode code since it uses thread-exit callbacks which are not supported for executables and DLLs containing managed code.
Pages: 1 ... 4 5 [6] 7 8 ... 10