« first day (1357 days earlier)      last day (1479 days later) » 

12:54 AM
@CătălinaSîrbu Because you don't delete it. It will be deleted after you exit main.
The delete x; is never called because you throw before you get to it.
Perhaps using a unique_ptr<X> x instead would do what you want.
 
 
1 hour later…
2:15 AM
If I have three objects, A, B, C. A creates B and C on the heap with new. A runs in the main thread with C, and B in a second thread. If B has a reference to A (passed in at construction), can you call A().C().someMethod() in B safely? Assuming inside someMethod it is just execution code and is not accessing any member variables?
 
 
3 hours later…
5:10 AM
@user3061694 if I understand your question correctly, then yes. "Assuming inside someMethod it is just execution code and is not accessing any member variables" so then yes, since no member variables are being accessed, then it's safe.
 
 
3 hours later…
7:49 AM
Question about std::async
 
 
5 hours later…
user7659542
12:24 PM
Why should I care about memory paging when writing my software,
 
user7659542
I am reading a book which provides an in depth explanation about this concept, but am wondering in which scenarios when writing my software this knowledge could realistically be useful
 
On Desktop platform it's only really useful for when your run out of memory and you're falling back on swap/pagefile
when configuring your Linux Kernel it might help you make an informed decision on page size
 
user7659542
@PeterT so there are cases when it could be usefull to have page sizes which are not 4kb?
 
yeah, larger pages can get you some performance benefits with some workloads
I don't think it's uncommon to have 1M pages configured
Also, you can use page protection for security purposes or page fault handlers for some sparse data loading
 
@PeterT for everyone saying "Just use std::async" exactly how can it be used to improve the situation? I'm guessing async would be declared outside of the loop, but it's not as if async can be restarted so it's still the same problem as std::thread has...
 
12:33 PM
@northerner if it's implemented with a thread pool then it should not be the same as with std::thread
 
In other words don't worry about, just put it in the same place as threads, is that what you're saying?
 
well the same is true as with every perfomance problem, measure it.
I just know that msvc implements it with the normal windows thread pool, not sure what the default libc++ libstd++ implementions do
 
What exactly is a thread pool again? I know g19fanatic said it's a fixed number of threads that have loops...but this definition doesn't make too much sense to me
 
It's what the name says, a pool of threads
 
ok so it's just a bunch of threads
 
12:39 PM
yeah and normally you have an interface to add a work-item for it to run
 
 
3 hours later…
3:13 PM
where can I find some book or exercices for cpa exam ? I cant find anything
 
 
7 hours later…
10:18 PM
could someone explain or provide me a link to read about preprocessors and Macro what are those. I would like a better understanding
 

« first day (1357 days earlier)      last day (1479 days later) »