I'm the Grumpy Old Ape sometimes answering C++ questions on Stackoverflow.
Usually you will find me in the C++ Lounge of the Stack Overflow chat.

I occasionally retweet something on my Twitter account, and I'm known to even generate my own tweets once in a while.

2h
comment How to make a multiple-read/single-write lock from more basic synchronization primitives?
@Howard: And as long as a single reader has it, new coming readers bypass a waiting writer, adding additional delay to its waiting time. At least, that's what I read from the algorithm.
2h
comment How to make a multiple-read/single-write lock from more basic synchronization primitives?
@frasnian: This is IA32.
9h
comment How to make a multiple-read/single-write lock from more basic synchronization primitives?
Thanks for the explanation! We're unsure because looking up didn't reveal anything.
15h
accepted Why can't I find unregistered users in user search?
1d
comment C++ character variable value of '\x1'
@peeppeep: Either you do not know what the problem is. Then you ask, read the answers carefully, and do try to understand them. Or you already know what the problem is. Then you don't ask. However, coming here asking (what seems an absolute silly question to everyone having done C++ for more than a few months), but then trying to tell the answerers they are wrong as if you know the answer better than them, is bad, reflects badly on you and makes you appear a wannabe smartass.
1d
comment My son has not started speaking properly, now he is 1 yr and 10 months
In Germany, the health insurance pays for your child to be taken to the doctor in set intervals for these checks. I find it very, very helpful to have someone professional do these assessments so you do not have to make those judgments ("any words. 'maa, daa, baa'") on your own.
1d
comment In divorce, who is more affected: boys or girls?
Are pigs or cows more upset about being eaten?
1d
revised Are variables real things?
deleted 62 characters in body; edited title
1d
comment How do I handle a 10 year old girl "in love"?
@trex005: Wikipedia says: "discipline is systematic instruction intended to train a person [...] to follow a particular code of conduct or 'order'" and: "Often, the phrase "to discipline" carries a negative connotation. This is the case because enforcement of order is often regulated through the threat of punishment to ensure given instructions are carried out." Now, even without that addendum, the last thing I want for my kids is to follow my order when they think they love someone. It's their life, their emotions. I provide help, if wanted.
1d
comment C++ character variable value of '\x1'
@dmg: So you want to not to mention a debugger to those who need to use it, because they don't know how to use it? Sounds like a good plan to keep yourself employed until your 110 years old. Count me in!
1d
comment C++ character variable value of '\x1'
And, wow! Almost a decade after even VS introduced "modern" for-loop scoping (which was about a decade after it was invented), it seems people are still taught it wrong. :(
1d
comment C++ character variable value of '\x1'
@dmg: OMG! Then, pleeeease, let's never mention the damn thing to them, so this won't change!
1d
comment What are several ways for a child Event Listener class to send event information to its owner?
So you write an absolutely vague question, and rather than downvoting and closevoting it, I attempt to answer. I start out with "Your question is vague, I believe this is what you ask. Is this right?" – and you don't even bother to even react to that, but come with a very dubious claim to ask a further question? Sorry, kid, no cookies for you, then.
1d
comment How to make a multiple-read/single-write lock from more basic synchronization primitives?
BTW, this seems wrong (in your text): "Suppose 1 reader is actually reading, and 9 readers are waiting in the condition_variable reader queue. When a new writer come in..." If readers have shared access, and a writer is yet to come in, no readers should have to wait.
1d
comment How to make a multiple-read/single-write lock from more basic synchronization primitives?
Oh, wait. It signals writers first. I hadn't seen that initially. Well, now it seems a serious bonus candidate! (That means: critique is very welcome!)
1d
comment How to make a multiple-read/single-write lock from more basic synchronization primitives?
Oh yeah: And since this is so close to what I had in mind, critique to it is especially welcome!
1d
comment How to make a multiple-read/single-write lock from more basic synchronization primitives?
Actually, all we have is semaphores, the rest is built atop of them. (Also, we don't have C++11/14's synchronization stuff, but that I file under "pseudo code".) Anyway, this looks pretty much like what I had in mind, only you show that it only needs a mutex for managing the lock's data, and none for actually accessing the data. Thanks for this one, it's definitely a bonus candidate!
1d
comment How to make a multiple-read/single-write lock from more basic synchronization primitives?
From here it looks as if unlock_shared(), when clearing the exclusive_waiting_blocked flag, releases both readers and writers, no?
1d
comment How to make a multiple-read/single-write lock from more basic synchronization primitives?
I have briefly looked at this. It seems to depend on atomics, which I don't think we have available. Also, IIUC, "spinning" means to wait busily. In a realtime environment, this you must not do, because it consumes CPU, starving tasks of lower priority. So, thanks for the suggestion, but I think this isn't what we need.
1d
comment How to make a multiple-read/single-write lock from more basic synchronization primitives?
We haven't found atomic operations in that OS's API.
1 2 3 4 5