« first day (1048 days earlier)      last day (3916 days later) » 

10:01 PM
That's more like it. Best thing, IMO, is to only have the stop() call in the dtor. Rule Of Zero all the way
So, remember to try/catch in your ctor too:
 
@not-rightfold You need a concurrent vector- i.e., a real tool.
 
try{
    // ...
} catch(...) { stop(); throw; }
 
user1804599
@sehe One problem.
 
user1804599
I need to terminate the threads in the catch block, not join them. stop() doesn't brutally terminate them, it just tells them to stop looping.
 
@DeadMG that's not actually the goal. He was rhetorically complaining ("how can I") because he didn't get me. He's doing a fixed size threadpool, IYAM
 
user1804599
10:05 PM
In some way.
 
(hint: you can't safely "terminate" a thread and continue running the main program)
@not-rightfold You need to tell it to terminate, and then join. Willams suggests "injecting" exceptions into the worker threads. However, this does involve "cooperative" scheduling still.
 
user1804599
I can send them start commands.
 
user1804599
Blewrg fuck threading without message passing abstractions.
 
Completely unexpected reaction of the day:
> @chris I do not question your expertise in C++ - I see what you write on SO. In fact, I don't think I am even in a position to question it. And if you wrote a nice review about using friends, quoting Standard etc - I'd upvote with two hands without even reading it, knowing it'll be a thorough and a useful one.
There's an actual comment in the rest of that, but I still don't see how I came across that way O_o
Maybe it was just the fact that I was wrong in that I fixed some of the answer but not all of it, and they were afraid to admit *I* was at fault. I don't really know.
 
user1804599
I have a great idea.
 
10:18 PM
wow, really?
 
user1804599
YES!
 
Patent it
 
user1804599
It's so fucking stupid that std::stack::c and std::queue::c are protected.
 
user1804599
So I'm going to privately inherit from them and publicise the member!
 
user1804599
10:25 PM
Hmm fuck.
 
Is a terabyte a megabyte but more afraid?
 
user1804599
I need a concurrent ordered container.
 
@TonyTheLion No, but it's more earthly.
 
@StackedCrooked I'd suggest you check for no_except move and refuse to compile otherwise.
 
@StackedCrooked hahah
 
10:26 PM
@sehe It's the do_send that might throw (network problem ..).
 
@not-rightfold Does the standard even specify those members?
 
user1804599
@sehe Yes.
 
user1804599
@StackedCrooked Then what's the problem?
 
user1804599
You want to undo the push_back and pop_back?
 
@not-rightfold Well, then it's not really sent.
@not-rightfold Right.
 
10:27 PM
@StackedCrooked Sooooooo. What do you want done?
 
Push the unacked segment back to the unsent list.
 
@not-rightfold Sounds very much like you just want to use deque/vector
@StackedCrooked so, try/catch, done
    try
    {
        do_send(unacked.back());
    } catch(...)
    {
        unsent.push_back(std::move(unacked.back()));
        unacked.pop_back();
    }
Of course, do something intelligent with the exception :/
 
rethrow I guess, I don't need to handle it there
 
Well, putting it back is handling it. I wouldn't expect a rethrow
 
It almost seems like finally would be useful.
 
10:33 PM
Not at all? Unless you also wanted to put the packet back on success?!
 
@sehe The send method should not silence exceptions.
 
I didn't say so. At the very least I'd wrap the exception so it is clear that the packet is back, the exception has been handled and the packet will be retried
5 mins ago, by sehe
Of course, do something intelligent with the exception :/
 
I guess this would work. But I'm so used to RAII that it feels wrong.
 
oh boy.
I'm really sick and the protection of it not being night time appears to be wearing off.
this is gonna be a long, long night.
 
user1804599
Man. I have a problem.
 
10:48 PM
What would you call an element (from a form) that takes a singleline text entry?
 
> an element (from a form) that takes a singleline text entry
 
@Pawnguy7 input field?
input area for multiline.
 
Ah. That might work.
 
user1804599
I'm fucked.
 
I have tried making input elements a few times before.
They worked... mostly.
Never was able to get my text input like you see everywhere else though.
 
10:53 PM
meaning what exactly?
 
Um... like, the backspace timing.
Or not making duplicate letters, but not slowing them down.
Though it appears the timing for holding backspace and holding a letter is the same.
 
11:04 PM
@Borgleader He's fornicated. He's copulated.
 
user1804599
Hmm.
 
user1804599
I wonder if there is a way to use custom events with poll or epoll.
 
user1804599
I could use pipe and write zero bytes. :v
 
@sehe I was responding to Pawnguy7 o.O
 
I think sehe has me ignored.
So I guess that makes sense.
 
11:09 PM
@not-rightfold that's actually a common trick to do thread synchronizatio in absense of pthreads, IIRC
 
cppreference uses this command line:
g++-4.8 -std=c++11 -O2 -Wall -Wextra -pedantic -pthread main.cpp 2>&1 | sed "s/^/C:/"; if [ -x a.out ]; then ./a.out | sed "s/^/O:/"; fi
They prepend compiler output with "C:" and program output with "O:"
 
user1804599
 
user1804599
I need to keep a multimap of ((file descriptor, event), green thread) pairs, then epoll, then choose one of the green threads (at random? sequentially?) to prevent starvation.
 
user1804599
And this isn't the difficult part.
 
user1804599
It starts getting fun when there is a pool of OS threads involved.
 
user1804599
11:19 PM
It may never happen that a green thread runs twice in parallel; that would be catastrophic.
 
user1804599
So I need to post them to the thread pool only if they are not already running. But how do I check that (and how can I prevent the check from creating a race condition)?
 
Which moron posted that shite?
 
user1804599
Me.
 
@not-rightfold Oh dear...
 
user1804599
(If you were talking about my rubber duck debugging messages.)
 
11:26 PM
@not-rightfold I wouldlike to say that your design is fucked up, but I'm so pissed on Courage Directors that I can barely stand.
Please. all Loungers, ignore anything I post tonite, 'cos ratted
 
11:47 PM
Why can't I fucking sleep before an exam?
JESUS!
 
my coworkers write lousy APIs. There's this set of classes we use to do stuff with audio that we're supposed to move to. I open up the one that gets audio from the microphone. It's supposed to be constructed, then I set the input audio format, output audio format, and the file to save to, then call initialize(), and then start. Now, pray tell, WTF am I supposed to set the input format to?
also, "docs" are comments in the implementation file
 

« first day (1048 days earlier)      last day (3916 days later) »