« first day (923 days earlier)      last day (4040 days later) » 

@ThePhD Are you using threads?
 
@StackedCrooked Yes.
I think I've pinpointed the problem.
It's about stale references and the fact that old threads aren't really "killed" like they're supposed to.
 
Threads shouldn't be created and destroyed very often. They should be reused.
 
I am
The lambda is meant to spin forever.
However
std::vector<Thread> threads;
threads.reserve(1);
threads.emplace_back( /* infinite loop lambda */ );
threads.emplace_back( /* infinite loop lambda */ ); // <--- resize trigger, old thread is not killed at all =/
This is the second time std::vector::resize has fucked me in the ass with an old thing not really dying.
This is kind of why I desired abort.
The solution?
 
what the hell are you talking about?
the resize isn't supposed to kill the previous thread.
 
7:06 AM
@DeadMG But the thread's destructor is?
 
not when it's been moved away from.
and in C++11 ~thread with a joinable thread is std::terminate().
 
Thread should be finished before destruction. You need a way to break the infinite loop so that the thread can finish. Then you need to join the thread. And then you allowed to destroy it.
 
not join() or detatch().
if the previous thread actually still had a thread in it, you would get a terminate.
 
I wonder why it's still double-spinning, then.
 
you pushed back two infinite loop lambdas.
so they should both be spinning
 
7:09 AM
@ThePhD the "resize trigger" resizes the vector and moves the old thread to the new location (AFAIK).
 
yep
 
If resizing just outright killed old elements then the container would be unusable
It's either a copy or a move but either way you're left with the same things you had before
Unless you'd make thread pseudocopyable in that it copy ctor wouldn't spawn a new thread but that would just be introducing funny bugs
 
@CatPlusPlus but references and iterators are invalidated. This could be a bug source here /cc @ThePhD
 
Well yes but that's a different issue
btw I'm pretty sure implementation is free to reserve more than the amount you give it in reserve() so that's another thing that destroys the behaviour you want
iow you're doing it wrong
 
@DomagojPandĹža I also use tabs, spacers gonna space.
 
7:19 AM
Don't start this shit
 
I'm not starting a shitstorm, I'm making a funnyz :(
 
However, returned future does not wait on destruction.
And this can be dangerous.
So now I kinda understand why std::async works the way it does.
 
as Herb put it
the Committee faced a decision on what should happen when an object representing an asynchronous operation was destroyed
and picked all three choices- join, detach, and terminate.
 
How so?
 
~future detaches (unless it's from async in which case it joins) and ~thread terminates.
 
7:23 AM
I see.
I didn't know future detaches.
 
all futures except those from std::async.
 
Actually, yes, I unknowingly knew that, since it doesn't block on destruction. (instead when returned from async)
I think it's silly that async without launch policy picks an unspecified policy.
So you don't know if your action will run threaded or not.
 
what even are the policies for async
 
deferred (sync, lazy) and async
 
that's the sillies.
so std::async(f, args, lazy) == a memoized std::bind then
 
7:26 AM
yes.
I find the deferred policy useful for composing a future out of intermediate futures though.
Perhaps there are better ways to do that. But deferred async is one way I found that works.
 
eh
future.then() should be Standard.
 
Indeed.
 
@LucDanton That was the original plan. I have been procrastinating it for a long time, though...
@Rapptz Actually, I have the whole vim config there.
 
Damn I'm still blind.
 
Hm.
 
7:33 AM
Hm.
 
Something is going horribly wrong, then. :D
And I don't know what it is. :D
 
@StackedCrooked That's misleading.
 
why hello there folks
 
enable_if can do things on the public API that tag dispatching cannot. here (not my best, but screw it)
 
Mawning
 
7:39 AM
It seems the sun has forgotten about the heat thing... it's so sunny, yet so cold
 
Damn that power interruption yesterday...
 
morning all
 
@R.MartinhoFernandes ok
 
Good morning to all.
 
@MarkGarcia how very rude of it
 
7:41 AM
@thecoshman I'll burn it in fire!
 
@MarkGarcia yeah! and may I suggest you pin it down with a pitch fork
 
@thecoshman Then I'll use the plastic ones just to be sure. :)
 
@MarkGarcia oh that smart
 
lol at this twitter password thingy!
 
@ThePhD It's built on the ideas I like the most about C++; call me weird, but it perfectly fits my mental model of how that domain is supposed to be handled, which is why I got the hang of it quickly; it does not let you do anything dangerous implicitly, and does everything that is safe implicitly for you. If you pay close attention, you will find a lot of the same design spirit in ogonek.
 
7:45 AM
@R.MartinhoFernandes I've begun to notice.
 
Very nice idea. A perfect exploitation of idiots.
 
@R.MartinhoFernandes To keep things simple, I actually subclassed my Timeout type from std::chrono::milliseconds.
Now it's compatible with almost every OS API in existence and it's very typesafe and nice.
 
What does your Timeout type do?
Oh gosh, I don't want to know, do I?
 
you subclassed std::chrono::milliseconds
 
Nothing, it's just a strong typedef and it also contains some os-specific const static Timeout members, like Infinite and Zero.
 
7:53 AM
facepalm
 
=[
 
user1357851
If the neighbourhood kitty tried to get my attention & meowing softly when I walk pass, can I assume she wants to be petted?
 
Why do you even need a strong typedef for that?
 
@Telkitty It's a trap to eat your hand.
@R.MartinhoFernandes Uh. I don't know. It's just for clarity. "This is a Timeout value. All Timeout values are in milliseconds."
 
@Telkitty If she doesn't go away when you come near her.
 
user1357851
7:55 AM
Kitty <3 fresh meat >_<
 
that's a comment in the header or documentation, no need for a strong typedef.
 
@ThePhD Erm, right, that's a normal typedef (and it doesn't really make much clearer).
 
ergh... being grown up and paying off student loan sucks :(
 
user1357851
@MarkGarcia some cats allow me to pet them, then try to scratch me
 
user1357851
There used to a cat from hell nex door - acting all nice & soft, when you get your hand close enough for her claws ~scratch!~
 
7:57 AM
@Telkitty Those cats that scratch, I try to scratch them back too. Softly in their head, I mean.
 
ITT: @MarkGarcia Scrapes out Kitty Brains.
 
@ThePhD I'd very well do that if the cat's scratch does a critical hit on me.
 
I need an interactive implementation of AES halp
That has OFB and CTR modes. OpenSSL only has ECB and CBC
 
user1357851
@MarkGarcia ITT @MarkGarcia wrestles with neighbourhood kittehs
 
So, I think I figured out my problem.
Sort of.
And I think I figured out a good solution.
... Sort of.
 
8:08 AM
@CatPlusPlus what do you mean interactive?
 
Like CrypTool
 
ah I see
 
Though I've been using 1.4 maybe 2.0 has modes
It doesn't have CTR
Dammit
Oh hey, crappy online tool that was linked in the assignment suddenly started to work
 
user1357851
@R.MartinhoFernandes rofl ... but why?
 
user1357851
8:15 AM
For once someone beats xeo
 
@Telkitty because we don't want that crap
 
user1357851
@TonyTheLion Which is?
 
I thought we had already made that abundantly clear on quite a few occasions
@Telkitty your silly videos and pictures
 
user1357851
that's not silly, it is a robot, almost a first stage AI
 
user1357851
what is wrong with you?
 
8:18 AM
Nothing is wrong with me
You're just a troll, and a bad one at that
I also don't know why I waste my time talking to you
 
user1357851
I am too interesting
 
user1357851
I was going to ask who would be rather happy with overtime instead of free pizza
 
8:34 AM
If it's unpaid, fuck that noise: Pizza!
 
Xeo
Meh, I got "paid" in a sense, for overtime - I got a tablet from my boss :P
 
@ThePhD You will also have no time to buy it or to enjoy it.
@Xeo You've been doing overtime?
 
Xeo
Two days, right before an important milestone - some weeks ago.
Worst thing being that nothing was really accomplished in that overtime, due to artists taking their sweet time with assets that we coders need to integrate >_>
 
I'm not sure how I should react to that.
 
Xeo
lol
 
user1357851
8:38 AM
nitwit
 
fitwit
 
Xeo
@R.MartinhoFernandes Why? :P
 
then gtfo
 
user1357851
you are talking to those children
 
user1357851
gl & hf
 
8:40 AM
I'm a tall guy.
 
I've spent time at home in the evening coding for work and even sometimes in the weekend.
I don't mind and care whether I get compensation, I just do it because I enjoy coding.
 
Xeo
Well, if I did C++ in that overtime....
But it was AS3
 
user1357851
@BrettHale This world is full of idiots need to be told what to do and tells you that you should be like them. But why, you are dumber, not as happy and poorer
 
user1357851
Why the heck would I want to be like you, sad f*ck
 
@Xeo ow
 
8:44 AM
So, yesterday I thought it was Friday but got disappointed... That's fine. Today I realized that an appointment I thought had scheduled for Friday was actually scheduled for Thursday.
 
@TonyTheLion s/mind and care/mind or care/
 
Xeo
@R.MartinhoFernandes Ahahaha
 
@thecoshman oh yea, grammar :)
@R.MartinhoFernandes oh damn
 
@Xeo It's not that funny from here, but I wasn't expecting a different reaction.
 
8:47 AM
Oh, looks like a fun day in the Lounge. Time travel and general moaning and angst. I think I'll do work today :(
 
@R.MartinhoFernandes forget it, was meant to ask Puppy that question
 
user1357851
I am done with this lounge this evening. I am off to more important aspect of life. Goodbye
 
@MartinJames you know, it can get better? :)
 
@TonyTheLion I have no idea why they were trading insults, but I don't care.
 
Xeo
@R.MartinhoFernandes :) What kind of appointment was it?
 
8:48 AM
ya
 
@Xeo Apartment visit.
 
Xeo
Ow, I take back the laughter.
 
Meh - I have a Win7-64 data migration thing I have to do. Might as well be today. Give Lounge time to settle down a bit.
 
8:50 AM
Was just venting, and this idiot decided to make a weird call. Anyway, I'm 2 beers further along now. The madness is fading.
So... how about that local sports team?
 
How do I capture something's that's a variable, but I want to capture it's pointer instead (address of?)
[ *var ] ? [ &var ] ?
 
@Xeo It's just particularly annoying that if I kept on the fantasy that it was Friday, I would not have missed it.
On the good side, I did not miss German class.
 
Xeo
@ThePhD Why do you particularly want a pointer?
 
@Xeo I don't want to copy by value because the variable itself will be deleted and changed or moved by the time the lambda gets to use it (async)
 
@ThePhD So you... want to capture by reference?
 
8:55 AM
The pointer to the variable, however, will always be alive (it's inside a unique_ptr)
So I essentially want to capture my_unique.get()
 
Xeo
[p = my_unique.get()]{ ... } // :D
 
o.0
You can assign new variables?
That's dope as shit.
 
Xeo
No you can't. C++14 can. :3
 
...
 
[&my_unique]
 
8:57 AM
q__________q
 
Xeo
Other than that, auto p = my_unique.get(); [p]{ ... }
 
I don't even see the problem in the first place.
 
Xeo
@R.MartinhoFernandes That won't work so well if the unique_ptr is moved from that scope, no?
 
@R.MartinhoFernandes my_other_unique = std::move( my_unique ); // Arrghs Dx
 
@Xeo Are you saying he actually has no control whatsoever about whether the pointer will survive execution of the lambda?
 
8:58 AM
@TonyTheLion and corrected by me of all people :D
 
@R.MartinhoFernandes Yerp.
 
Xeo
3 mins ago, by ThePhD
@Xeo I don't want to copy by value because the variable itself will be deleted and changed or moved by the time the lambda gets to use it (async)
 
@Xeo That's just broken, isn't it?
 
last day!
 
Goddammit, I have to use a proxy for operator-> with an input iterator correct?
 
8:58 AM
and 9 days of sweet freedom
 
@BartekBanachewicz Parrrtaaay.
 
also morning
 
@LucDanton btdt, yes.
 
Iterator where value_type == reference to be precise.
 
@Xeo It's like... unsafe by design...
 
Xeo
8:59 AM
:)
Not my problem
 

« first day (923 days earlier)      last day (4040 days later) »