- Regal eagle / American cloud - 3 Updates
- Can I pass a shared_ptr to a thread as a temporary ? - 5 Updates
woodbrian77@gmail.com: Feb 08 07:54PM -0800 On Friday, November 1, 2019 at 2:25:05 AM UTC-5, Bonita Montero wrote: > > Can you give me some suggestions on how to improve my > > repo: https://github.com/Ebenezer-group/onwards ? > Yes: delete it and stop posting here. Sorry, but it's been onwards and upwards for over 20 years now. The software is better than it has ever been. Services are the way things have to be now. Brian Ebenezer Enterprises https://github.com/Ebenezer-group/onwards |
Ian Collins <ian-news@hotmail.com>: Feb 09 07:52PM +1300 > 20 years now. The software is better than it has > ever been. Services are the way things have to be > now. You've been pedaling that snake oil for almost as long. -- Ian. |
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Feb 09 12:54PM -0800 > The number of lines hasn't changed much, but the size of the > event loop, the most complicated part of the program, has been > reduced by switching from TCP to SCTP. Thanks in advance. Iirc, you require a user to "register" by sending you an email with their password in the clear? |
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Feb 08 07:12PM -0800 On 2/8/2020 4:32 AM, Bonita Montero wrote: > threads.emplace_back( scnThread, shared_ptr<wstring>( new wstring( > nextFilePattern ) ), nextPathLength ); > Can I rely on that the thread gets its copy of the shared_ptr How is that other thread getting its copy to begin with? Is this thread, assuming scnThread, running? Or, do you start it up after adding its "descriptor" the threads container via emplace_back? > before all shared_ptr-copies in the initiating thread are desroyed? How are you communicating between threads? |
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Feb 08 07:24PM -0800 On 2/8/2020 7:12 PM, Chris M. Thomasson wrote: > "descriptor" the threads container via emplace_back? >> before all shared_ptr-copies in the initiating thread are desroyed? > How are you communicating between threads? Are you creating scnThread in the constructor of the object that gets added to the threads container? If so be careful. I have seen some nasty nightmares that create a thread in the constructor that starts running _before_ the damn ctor is even completed! The running thread just blindly assumed that the ctor was finished, NOPE! |
"Öö Tiib" <ootiib@hot.ee>: Feb 09 05:23AM -0800 On Saturday, 8 February 2020 14:32:31 UTC+2, Bonita Montero wrote: > nextFilePattern ) ), nextPathLength ); > Can I rely on that the thread gets its copy of the shared_ptr > before all shared_ptr-copies in the initiating thread are desroyed? It might be code of some "using namespace std;" tutorials/noobs or it might be whatever. Just dump the attitude that you may get answers to trash like that. C++ does not compile line by line. Post whole compiling example or go troll elsewhere. |
Paavo Helde <myfirstname@osa.pri.ee>: Feb 09 05:28PM +0200 On 8.02.2020 14:32, Bonita Montero wrote: > nextFilePattern ) ), nextPathLength ); > Can I rely on that the thread gets its copy of the shared_ptr > before all shared_ptr-copies in the initiating thread are desroyed? The initial data passed to std::thread should be passed to the std::thread constructor where it will be copied or moved appropriately before the thread starts. Any time later one will need more elaborate synchronization. Your example does not really contain enough information to say if it is correct or not, important types are missing. Assuming that 'threads' is e.g. a std::vector<std::thread>, the code would be OK as emplace_back() would indeed pass the data to the std::thread constructor. |
Bonita Montero <Bonita.Montero@gmail.com>: Feb 09 05:12PM +0100 > it might be whatever. Just dump the attitude that you may get answers > to trash like that. C++ does not compile line by line. Post whole > compiling example or go troll elsewhere. I posted everything to understand the issue. The code is sufficient and the description of the question as well. And I see you didn't understand it. |
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page. To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com. |
No comments:
Post a Comment