« first day (3895 days earlier)      last day (1036 days later) » 

1:50 AM
Good Feeds, But I was looking at my hands to figure out the right one
 
 
6 hours later…
7:54 AM
Hi, Could anyone please help me how to create batch file that is to find and remove the shared memory?
 
Hi All, is it possible to clear a shared memory using bat file in windows, if so, how we can clear? Could you please provide any suggestion.
 
wut I'm confused, I thought linux was the one with shared memory files that can outlive processes, and windows was the one that killed it when the processes were all done?
also, why are you guys asking the same question
I guess, first what is "shared memory" to you
because it could the interprocess communication thingy, I've also heard people use it to mean GPU/CPU main memory segmentation
 
morning
 
good morning
 
this morning needs another coffee
 
8:02 AM
@PeterT, I have created shared memory to use multiple processes for interprocess communication. When uninstalling the application, wanted to remove the shared memory using the .bat file
 
8:21 AM
you mean like a file that you map?
just delete the file
 
 
2 hours later…
nwp
9:56 AM
Somehow I just now realized you can use inline for static class member variables.
 
well it is comparatively new
like c++14 or 17 it was
 
nwp
17
I did it before with regular variables, but never questioned defining static class ones in the source file.
I blame ... uh ... not having proper co-workers.
I kinda wonder if there are adverse linking performance effects, but I'd probably pick convenience over link time performance anyways.
 
I doubt it makes a noticable difference, resolving all the duplicate template instantiations from vector<T>, etc. is going to be a lot more expensive than the handful of static data members most applications have
 
 
3 hours later…
12:39 PM
@PeterT my understanding from the MSVC blog is they focused really hard on reproducibility of the sections, each pre-linked segment contains a hash they used to identify possibly duplicate ones
 
I guess it's more the producing of the duplicate instantiations that takes time, not the deduplication
 
dunno, what they weren't clear is what happens if you have something like std::vector<int> and std::vector<unsigned> it made it sound like they treat those independently
even though technically they are compatible types from a container perspective
 
Hello All, could some one please help me if there is any way to use the shared memory (create and delete) with VB script?
 
12:55 PM
@JohnPaulCoder This is A) a c++ channel, B) C++ questions would go chat.stackoverflow.com/rooms/116940/c-questions-and-answers
 
@Mgetz, ok.
 
 
2 hours later…
2:56 PM
What do you guys think of unity builds?
 
it's a shitty workaround, but it's a shitty workaround that works. So if it helps, use it.

But if possible I'd say use it with tools like cmake, so that you can easily adjust the unit sizes/turn it off
 
nwp
I never tried it. From what I understand it improves performance that should already have been regained by link time optimization. Since I don't care about performance it's not interesting to me.
 
it's possible that it improves with template reinstantiations, where each translation unit instantiates all the templates and redoing all that work
 
it's not about link time optimization, it's more about not having to parse thousands to hundreds of thousands of lines of codes multiple times and save you things like template instantiations
where I've seen it used it was about build-times, not runtime performance
 
it precompiled headers and modules aren't good enough to improve compile times it might be worth a try
 
3:02 PM
Basically all of my code is templates or inline, and its taking too damn long to build because its all in one TS
 
@Mikhail cries in anonymous namespace
 
well if it's already all in one TS, then how would unity builds help?
they're about reducing translation units
wait, how did I read TS as translation unit, ignore that
 
Indeed. But I'm thinking of splitting everything into .cpp files (multiple translation units) and then using unity builds for the release version.
@PeterT yeah, I think I made a typo
I don't know I got like 5 hours of sleep so I'm basically drunk :-/
good morning
 
nwp
I improved compile times by splitting a file before. All of them include SOL2 which is 5KLOC of templates and still splitting them made compiling faster. Mostly because the memory requirement dropped massively and the machines didn't have enough.
 
But I do think the intention of unity builds is to have a dual kind of build option, where you can split into multiple units for incremental updates and have a monolith for the release.
@nwp How does that work? Now you're including SOL2 in multiple files?
 
nwp
3:08 PM
Yes. All the files are much smaller than before.
It basically hooks up Qt with Lua, so there are various GUI elements like a button or checkbox that are added to Lua via Sol2. Originally it was just 1 big file where all the elements were added. That proved to not be sustainable. Now it's individual files per GUI element and it compiles much faster and uses a lot less memory.
 
So, how do you avoid constantly rebuilding Sol2 in each individual GUI element TU?
 
nwp
I didn't. Every file parses the 5KLOC of Sol2.
 
just don't recompile every file each time
 
nwp
Somehow there is an n² algorithm somewhere in the compilation process and having too many symbols made it take forever. (n/k)²*k turned out to be a much smaller number.
 
sounds like a definite bug in the compiler...
 
nwp
3:13 PM
And in the linker too.
But I mean if you have a 400MB .o file it's gonna take a while.
 
it shouldn't though
 
nwp
Oh, not emitting debug symbols helped immensely for compile and link times, though it sucked for debugging.
 
you should be able to read and write a 400MB file in only a few seconds
and that read write should be your bottleneck not your O(n²) processing of symbols
 
nwp
I remember having to mess with Travis because it stops the build if a single command runs for more than 10 minutes without output.
 
the reason some cli programs have a progress bar option...
 
nwp
3:17 PM
It helped for a while, but eventually it took over an hour and it killed the whole build no matter what printing tricks I did.
It's now down to 15-23 minutes for the whole thing, depending on what hardware it happens to run on.
At least I assume that's the reason why build times vary.
 
disk cache and ram availability would be my guess
 
nwp
We added more stuff since then, so the splitting definitely was worth it.
 
 
4 hours later…
7:35 PM
Well I asked a question on SO:
https://stackoverflow.com/questions/67992406/why-is-an-external-template-redeclared-as-a-different-kind-of-entity
 
and another coffee =w=
I want to spend a day reading in a library café
 
@Mikhail could have sworn that was removed completely
 
What thing?
 
@Mikhail extern templates
 
Oh I think they are fine, it used to be an MSVC thing
but in this case its not an extern template, but rather the object should be extern...
an extern template, from what I recall would require having the completed type immediately after it, and would basically instruct the compiler to not generate the template except for one explicit location
 
7:42 PM
 
in my case though I need the actual object to be made somewhere else...
or at least thats what I think
@Mgetz Yeah that has different functionality, because in the original one I could write pool<int>, pool<float> etc
 
@Mikhail but that creates a new instantiation? which can't be extern
you have to have an explicit instantiation to have a linkage
 
@Mikhail yes but you're instantiating in that case right there
you can't have a non-explict instantiation extern
 
indeed, so how does one instantiate in another TU?
 
7:45 PM
so if you want shared extern code you'd need to move that to a base class
just like any other template... again
let the linker sort it out
or do explicit instantiations
you can't have external linkage to something the compiler doesn't know the type of
 
yeah I'm trying out how to do explicit instantiations
but can't quiet get the syntax right...
 
@Mikhail are you trying to specialize the pool or the do_something()?
 
the pool
2
A: Why is an external template redeclared as a "different kind of entity"?

n. 1.8e9-where's-my-share m.You can do one of the two things. Make pool a normal variable. extern PoolType<int> pool; // in some other file PoolType<int> pool; // in main pool.do_something(); Make pool a variable template. template <class T> extern PoolType<T> pool; // in some other file template <> PoolType<int> pool<int>...

Looks like I got an answer, seems it needed two template tags which is weird...
 
@Mikhail FWIW I don't think it gets rid of the template being instantiated in both TUs in the second case they present
 
hmm, maybe need to test it more then :-/
 

« first day (3895 days earlier)      last day (1036 days later) »