« first day (1846 days earlier)      last day (3103 days later) » 

11:00 AM
yawn
 
@chmod666telkitty whats your tech stack at your company?
 
Xeo
HAHAHAHAHA
They tried to deliver the food I ordered yesterday just now. Obviously I'm not at home. /cc @AlexM.
 
@edition Just me, I partnered with 2 others on 2 projects. But just on clients projects, nothing to do with any of the apps under my company name
(Don't laugh)
 
hey, I'm not laughing. I don't even have a job!
 
I thought you are in uni
 
11:12 AM
polytech, but that's here-and-there because of my lazyness (at times), and programming is time consuming.
evidently, poor planning is detrimental to programming and study.
 
I could only do one at a time: coding for work or study. I sucked at both when I try to juggle both at the same time.
 
Ven
@Elyse even in the C++11 solutions I found, there's always this problem that this creates a big overhead for pure read workload :(
 
anyways afk for lil while (real life stuff) brb
 
@chmod666telkitty apology accepted
 
user1804599
@Ven RIP you.
 
Ven
11:17 AM
@Elyse I don't see a way to be very, very fast for a read (it can totally be optimistic, writing shouldn't happen often), but still not crash when I write
 
user1804599
One readable memory location, one writable memory location, and a pointer pair that can be swapped atomically.
 
user1804599
Dunno. Shared memory causes cancer.
 
user1804599
What does the writer write?
 
Ven
changes the map of connections. but I don't want to do that while people are using said connections
 
user1804599
Do writes take a long time?
 
user1804599
11:25 AM
Try spinloops with an atomic Boolean.
 
Ven
they do, but it doesn't matter that it does. writes are gonna happen once a month or something
 
user1804599
This should be safe from data races and deadlocks. Order of assignments vs spinloops is important.
 
If you have a bounded number of readers that can simultaneously access the resource you can get rid of the writer atomic
(It's a fun exercise)
 
user1804599
std::atomic<bool> writer;
std::atomic<int> readers;
std::set<pool> pools;

void write() {
  while (readers > 0)
    ;
  writer = true;
  scope(exit) writer = false;
  // write pools
}

void read() {
  ++readers;
  scope(exit) --readers;
  while (!writer)
    ;
  // read pools
}
 
@Xeo yea forgot to mention
orders outside of working hours are treated as preorders
tho I think that considering that you ordered like 6 mins after the day ended
they should've called first to make sure
 
Xeo
11:34 AM
@AlexM. twas within working hours though :<
@AlexM. before
 
oh
really nasty of them then
 
user1804599
 
user1804599
comment on line two is what reduces overhead
 
Ven
@Elyse that's really cool C++17 code
 
user1804599
It's not C++17 code.
 
Ven
11:39 AM
@Elyse what's that shared_mutex?
 
user1804599
It's C++03 code augmented with D-like scope(exit) pseudo statement (which can be implemented as a macro, see Boost.ScopeExit, or can be rewritten as a class that uses RAII).
 
user1804599
@Ven Any shared mutex library will do.
 
user1804599
Readers won't have the locking/unlocking overhead until the writer wants to do its job.
 
user1804599
If spinloop is too CPU hungry, use a condition verbibol instead.
 
Ven
@Elyse ok. case: I read(). It checks write_request. it's false. As I check, it goes to true and locks. I act on the pools. boom
 
user1804599
11:42 AM
Check what?
 
Ven
write_request
 
user1804599
Who checks it?
 
Ven
right after I saw it being false, bam, it's true. threads!!1
still read()
 
user1804599
Please be more specific.
 
user1804599
No, the writer won't do anything until read unlocks the mutex.
 
user1804599
11:43 AM
Then the reader won't do anything until write_requested becomes false.
 
Ven
@Elyse but write_request can become true right after read's if. even if it was false a microsecond ago. And then, nothing prevents write() from butchering stuff
 
@Elim u ded
 
user1804599
@Ven Yes, but then the reader still owns the lock on the mutex, and the writer can't continue on line 9.
 
@GregorMcGregor he ded since yesterday bro
 
ayyyy rip
 
11:45 AM
he died in an anti aliasing accident
 
Ven
@Elyse no, the read didn't lock, because at the time of its if, write_request was false. it only got to true on line 19
 
user1804599
If the mutex lock is being held by any reader, it means "write request not yet acknowledged".
 
Ven
but it'll only be held in read's if
 
user1804599
@Ven see comment on line 2 and 3
 
Ven
there's no "reader thread" or "writer thread". only users clicking button. might be "read" button, might be "write" button, but that's the same thread
 
user1804599
11:46 AM
void spawn_reader() {
    spawn_thread([] {
        shared_lock lock(mutex);
        for each read request { read(); }
    });
}
 
user1804599
@Ven Then where is the concurrency aspect?
 
Ven
the overhead you're removing with your solution is most definitely back with that thread + the following .join()
 
user1804599
If it's the same thread, there's no need to bother with concurrency problems at all.
 
Ven
@Elyse more than one user. but i don't know who'll press which button/when
 
user1804599
11:48 AM
So the same thread might call either read() or write()?
 
Ven
yes
 
user1804599
Then release the shared lock before write and reacquire it afterwards.
 
@AlexM. aww
 
set(ENV{CCACHE_CPP2} 1) is not having any affect on ccache when trying to build with cmake?
 
C. C. Cache
 
user1804599
latest diff
 
@AlexM. Sorry, don't follow
 
I won't
this is def the best c c catch song youtube.com/watch?v=IV3SCgOLSUs
I like the lyrics
as well as the melody
 
user1804599
@Ven no; thread pools
 
user1804599
Note that, with this code, while read() is thread-safe, write() must not be called concurrently. If you want to allow concurrent writers, add another mutex that write locks when called and read doesn't bother with at all.
 
Xeo
12:09 PM
ugh. Chugging down 1l of water may not have been the best of ideas.
 
I just did, in the past 30 minutes
 
12:32 PM
That should settle soon.
 
@AlexM. trigger warning... "c" "c"
 
C/C+
 
@nishantjr good for Stack Overflow. What compiler are you using that this matters?
 
@sehe I'm using clang. Just realized that I needed to set the ENV var at build time -- not configure time. Setting it for ninja worked like a charm
 
C/C++ is undefined behaviour.
 
12:38 PM
@nishantjr Why would you need to disable CPP optimization, is my question
@rubenvb wrong o.O
 
dammit. I knew I shouldn't have said that.
 
@sehe Clang separates the arguments that are passed to the C preprocessor from those to the compiler. If you pass the CPP args (eg: -I) to the compiler, it complains
 
@sehe what about example 3 at the bottom here?
 
fu? :)
 
@nishantjr It doesn't necessarily? You can call it just like you call gcc...
 
12:46 PM
@rubenvb I was getting a bunch od "argument unused during compilation" warnings
 
@nishantjr what was the invocation?
 
ccache clang++ ...
 
what's the "..."?
Seriously.
 
Hold on. Let me dig it up
ccache clang-3.6 -std=gnu11 -g -Wall -Werror -fcolor-diagnostics -fPIC -I. -I../../../../.. -I../../../../../src -isystem ../../../../../release/include -isystem ../../../../../../boost-atp/release/include -MMD -MT CMakeFiles/XXX/version.c.o -MF "CMakeFiles/XXX/version.c.o.d" -o CMakeFiles/XXX/version.c.o -c version.c
@rubenvb
 
user1804599
 
user1804599
nice
 
@nishantjr and which one would be ignored?
The include directory option -I?
Then I would blame ccache.
 
> 3 conseils pour bien palper vos testicules
 
@Morwenn WTF
 
1:07 PM
@Rerito To prevent cancer. It may sound dumb but it can actually save lives.
 
@rubenvb Yup. Take a look at this : petereisentraut.blogspot.sg/2011/09/….
I'm not sure I'd blame anyone -- there's no standard for command line options.
 
Also never forget that men can have breast cancers too. Don't ignore the symptoms.
 
I'm leaving now
 
It was the minute of prevention :D
 
@rubenvb Oh Sorry, thought you said clang. I dunno - it's a 10% speed saving according to the blog entry I read. ccache trys not to interpret the arguments, so I suppose having the option to disable the optimization is the best it can do.
 
Ven
1:10 PM
@Elyse hey, it's your best friend! github.com/NICTA/xsharpx/issues/4
 
user1804599
@Ven yes I know.
 
user1804599
also no he's not my best friend
 
Ven
:o
 
@nishantjr Maybe you can pass the options to CPP like you said, I guess ccache does its best to use CC/CXX/CPP/CFLAGS/CXXFLAGS to the best of their intention.
it is fundamentally wrong to put a full command in CC/CXX.
But the problem is that not every part of the build system respects all the other stuff.
 
You can't spell fap without fp!
 
Ven
1:13 PM
pfft, Kotlin. All the cool kids use Ceylon.
 
@rubenvb Hmm. Then you'd have to go after cmake.
 
Cool kids don't program. They're out partying.
 
@nishantjr cmake has options to set all those separately I'd think lemme check... Hmm guess it doesn't
 
@Ven Really? I haven't seen anybody use Ceylon yet.
 
Ven
@fredoverflow I haven't seen anybody use Kotlin either, TBH :P. but ceylon seems more powerful, so yay for that I guess
 
1:15 PM
I tried Ceylon once, but it adds an even bigger dependency (11 MB) to your project than Scala (7 MB).
 
Ven
@Morwenn that's tonight
 
Really? I'm not setting the command line at any point. Just the various variable is has. I'm on 2.8 though.
 
Ven
@fredoverflow holy shit what? 11mb????
 
Yes. For projects of my size, that's like a hundred-fold increase in binary size.
 
@Ven Where is it? :o
 
Ven
1:17 PM
@Morwenn in paris. that's where I drink.
's not a cool kid anyway
 
@Ven Too bad, I'll drink in Brest then.
 
Ven
@Morwenn you'll drink Brest's rain? :P
 
@Ven Nope, good breton ale.
 
Ven
:( now i'm a bit jealous
 
You can come if you want :D
 
Ven
1:19 PM
I better start walking then..
 
@fredoverflow make a bigger... project then
 
> projects of my size, that's like a hundred-fold increase in binary size.
you must be really tiny
 
@Morwenn Why not with Brest de Nest that was terrible T_T why is this not friday... so tired
 
@Borgleader Wow.
 
@Morwenn ikr, truly terrible
 
user1804599
1:29 PM
@fredoverflow For a 1B project, adding 1B is a 100% increase in size.
 
@Borgleader I... I can't even find you any excuse .____.
 
Ven
you recognized it was terrible, so you have at least this for yourself, which is nice : ^)
 
@Elyse So?
 
I just noticed
the lowercase lambda looks like a hand holding a crowbar
half life 3 confirmed
4
 
user1804599
@fredoverflow So it's unacceptable!
 
1:34 PM
@Elyse I was talking about 100x, not 100%.
 
@fredoverflow don't confuse him with your numbers
 
user1804599
@fredoverflow Then add 100B!
 
So what byte should I start out with... the RET instruction? :)
 
@Morwenn Will you ever for give me? :(
 
@fredoverflow Seems like it was simpler back then.
 
1:39 PM
@Borgleader I might. Someday.
 
@fredoverflow -1 not even using git
 
Lack of sleep is killing me -_-"
 
user1804599
Then sleep. Problem solved.
 
I'm at work
 
I still don't see why you couldn't sleep.
 
1:48 PM
@fredoverflow no to bohemianism :D
 
user1804599
@fredoverflow do not allow any statement after a return statement:
 
user1804599
data Stmt = NullStmt Stmt | ExprStmt Expr Stmt | IfStmt Expr Stmt Stmt Stmt | ReturnStmt Expr
 
what?
 
@v.g. yo' momma
 
:grabs popcorn:
 
1:52 PM
@rlemon hehe I got invited here
moar popcorn needed
 
Ven
mh, APL has a few ways to filter an array...
 
user1804599
@Ven APL OMG! <3
 
Ven
I could just index in [seq] then remove rho(seq)+1 then index back in
or just vec~seq :v
 
@Elyse Oh syntax rule instead of semantic rule? Nice :)
 
Ven
(my palindrome implementation was cuter before I discovered the triple bar slash)
@Elyse you are Free now!
no, I can't use ~ if I don't know which elements are not in the sequence. but e and / work fine..
 
1:56 PM
Now eating: "grenade apple". That's what it's called in Germany. Can you guess what I mean? :)
 
pomegranates are delicious
but so messy
so so messy
 
user1804599
@Ven ,/{⍵≠0:⍵⋄⍬}¨1 2 0 3 ¯3 0 5
 
user1804599
Filters out all zeros.
 
@Morwenn How many burritos will it cost me? :P
 
7
 
user1804599
1:57 PM
      ,/{⍵≠0:⍵⋄⍬}¨1 2 0 3 ¯3 0 5

┌──────────┐
│1 2 3 ¯3 5│
└──────────┘
 
Ven
@Elyse 1) only works in dyalog apl 2) really verbose way to write 0 1 2 3 0~0
 
Ven
also ugh, that abuse of the empty vector and of the comma... ;)
 
user1804599
@Ven Yes, but this can be generalised. Swap out ⍵≠0 for any predicate.
 
@rlemon I just tried it for the first time, and the technique work great.
 
Ven
1:58 PM
@Elyse I think it's better to use / if possible
 
translate please
 
@rlemon Translation not necessary, just turn off audio and see what he does.
 
user1804599
If only APL had HOFs: filter←{,/{⍺ ⍵:⍵⋄⍬}¨1 2 0 3 ¯3 0 5}. :P
 
@fredoverflow good, then I can continue to enjoy lil dicky
 
@Borgleader Between 0 and 10. Don't assume radix 10.
 

« first day (1846 days earlier)      last day (3103 days later) »