upvote
What specifically are you saying can make a difference?

I'm saying that extra overhead from making your lock work across processes should be very tiny. That overhead shouldn't add much more than a microsecond in either latency or CPU usage, compared to an in-process lock.

reply
You were saying "reasonable overhead" makes no difference because something "isn't called much". This is not only ambiguous but also not true because latency is important.

What calls specifically are you talking about between windows and linux? This was started by someone talking about WaitForMultipleObjects.

reply
I wasn't excusing all overhead, I was excusing the difference in overhead caused by making the lock more flexible. Because that's what the discussion is about, a lock that can be shared between processes versus a lock that can't be. The penalty for being "too flexible".

But assuming reasonable implementations, the difference between those two lock styles shouldn't be more than about a microsecond, should it? So that's fine for a lock that's only used 100 times a second.

I'm not comparing windows and linux anywhere.

reply
I was excusing the difference in overhead caused by making the lock more flexible

What are the two functions you're comparing and what is the actual difference in overhead that you're talking about?

a lock that can be shared between processes versus a lock that can't be.

This is a dramatic black and white difference, these would be used for two different things. In that case it's apple and oranges, one would be for interprocess communication and one wouldn't.

the difference between those two lock styles shouldn't be more than about a microsecond,

What are you basing this on? Do you have an examples or benchmarks of the actual calls and their timings?

fine for a lock that's only used 100 times a second.

Again, latency isn't about how many times something is called per second. That would matter for throughput.

reply
> What are the two functions you're comparing

Go ask this comment, because I'm continuing their comparison: https://news.ycombinator.com/item?id=48125795

> In that case it's apple and oranges, one would be for interprocess communication and one wouldn't.

The whole point of the complaint was wtallis claiming the inter-process-capable lock was being used for locks that don't need it! That's the foundation of this conversation!

> What are you basing this on?

Basic coding knowledge and an assumption of competency. There's no good reason for it to slow down more than that when it's used the same way. If you have a reason go ahead and tell me.

> Again, latency isn't about how many times something is called per second. That would matter for throughput.

I addressed both.

The extra latency for using an overly capable lock should be negligible. That's not the problem anyone is worried about.

reply
Basic coding knowledge and an assumption of competency.

This is just saying "I just know", but what specific function and basic timings are you going off of? If you don't know, why are you so sure of the numbers?

The whole point of the complaint was wtallis claiming the inter-process-capable lock was being used for locks that don't need it! That's the foundation of this conversation!

They were saying it's rare to need IPC lock for video games and I don't think that's true, then I gave a scenario where you would use one.

reply
If you're not actually using it between processes, the overhead could be as small as an extra conditional. For an upper bound I think a couple wasted syscalls makes sense. Why would it be significantly slower than that?

But whatever, let's focus on the actual point:

> They were saying it's rare to need IPC lock for video games and I don't think that's true, then I gave a scenario where you would use one.

And I was pointing out that a voice IPC lock is still "rare" when we use the most appropriate definition of "rare" for this context. In this context of worrying that using the wrong kind of lock will slow the game down, how often we're using the lock matters. If we go 50 million CPU cycles between uses, it's "rare".

reply
how often we're using the lock matters.

No, latency is what matters.

And I was pointing out that a voice IPC lock is still "rare" when we use the most appropriate definition of "rare"

This isn't really a point with explanation, it's just you saying 'nu uh', even though that was just a single example.

reply
The post you originally responded to was comparing the general idea of locks that can work between processes and ones that can't. And it was criticizing the efficiency of the former, which is a measure of throughput.

There's no reason for an upgraded lock to significantly change in latency. That's not what they were worried about when criticizing the idea of using the former lock as the main lock type in a game. Your most used locks need throughput.

So no, latency is not what matters. And I've explained why I say that in multiple ways, while you haven't given any explanation for why you're focusing on latency.

When they asked "how often" in the middle of that criticism, they're not looking for an example that sprinkles in a couple calls, they're looking for something that puts serious load onto the lock. Any answer that is once per frame or less is not properly addressing the question.

reply
So no, latency is not what matters. And I've explained why I say that in multiple ways,

No you haven't, you keep talking about doing something 100 times, but if you have a lock between processes, getting those processes to wake up and know the unlock happened with low latency is what matters. After the unlock whatever happens is going to be fast anyway, which in IPC is probably going to be copying memory.

What specific function call are you thinking of that would have high overhead but not latency and the latency wouldn't matter?

you originally responded to

I replied to someone saying "how often do you use a shared lock in games" and I said there are obvious uses.

reply
> No you haven't, you keep talking about doing something 100 times

That has not been part of all my explanations. But just so I can make it as clear as possible I will now explain it again without mentioning how many times it's called anywhere in the rest of my comment:

> if you have a lock between processes, getting those processes to wake up and know the unlock happened with low latency is what matters

Whether it matters depends on what you're benchmarking.

When the alternative to IPC is waking up another thread, your latency should be about the same either way. It's not what they were trying to compare.

The core comparison they wanted to make was about the simplicity of using a single lock type versus the overhead of using an IPC-capable lock everywhere. A better way to phrase their actual question is about how deep those IPC needs go in contrast to their downsides, not just whether there's a single call site somewhere.

> I replied to someone saying "how often do you use a shared lock in games" and I said there are obvious uses.

You gave a perfectly good answer to the half a sentence you quoted, if that half sentence was in a vacuum. But it was not in a vacuum, and your answer was not good for what they were actually asking.

reply
You gave a perfectly good answer to the half a sentence you quoted,

Good, because that's what I meant to do, which is why that's what I quoted.

reply
And so my first comment clarified that you didn't answer the question. But if answering just that half sentence was on purpose, why did you argue with me???
reply
They asked how often an ipc lock would be used in games and I answered.

why did you argue with me???

You replied to me.

reply
> They asked how often an ipc lock would be used in games and I answered.

You did not answer the question they asked. You answered what would have been a reasonable interpretation of half of their sentence, if there hadn't been more text directly around it.

> You replied to me.

I did.

But if you were purposefully isolating half their sentence, there was no reason for you to argue with that reply. The way you argued implies you weren't doing that on purpose, and thought you were answering their actual question.

reply
You did not answer the question they asked.

They did ask it because I quoted it and replied. That's how these forums work. People write text and other people reply to it.

The way you argued implies you weren't doing that on purpose, and thought you were answering their actual question.

No, that's not true, I think you made all that up.

reply
> They did ask it because I quoted it and replied. That's how these forums work. People write text and other people reply to it.

No, you quoted half a sentence. That wasn't the whole question. You didn't answer the actual question.

The fact that you're still insisting you answered the question makes it clear why you argued with me when I was just clarifying things. You didn't answer something different on purpose, you're still stubbornly acting like you answered the right thing.

You did not answer their actual question. Period. I'm leaving now.

reply
You did not answer their actual question.

They asked two questions and I answered one. You hallucinated timings to imaginary functions you couldn't name.

Period. I'm leaving now.

You inserted yourself and had a meltdown. I don't know why this was so upsetting but you couldn't actually give a single technical detail, it was just "I just know" and "ask them what function I'm talking about".

reply
They were asking an abstract question, it wasn't about specific functions...

And you were just as stubborn/'meltdown' when repeatedly insisting it was about latency. They never mentioned latency.

reply
They were asking an abstract question

No it wasn't (I think you meant rhetorical). They might just have not expected a reply.

And you were just as stubborn/'meltdown'

I didn't reply to you.

when repeatedly insisting it was about latency. They never mentioned latency.

I mentioned it once you mentioned overhead, because that's what is actually important between processes.

reply
> No it wasn't (I think you meant rhetorical). They might just have not expected a reply.

I don't mean rhetorical. I mean abstract in that it wasn't about specific locks, it was about types of lock. That's why I didn't try to name any particular functions.

> I didn't reply to you.

In your future replies to me.

If you're not talking about later replies... are you implying you were calling my first comment a meltdown? Weird.

> I mentioned it once you mentioned overhead, because that's what is actually important between processes.

The main worry expressed in the original post was about the throughput of using an IPC lock in places that don't need an IPC lock. That's the overhead I was talking about.

reply
it was about types of lock.

That's what I answered.

are you implying you were calling my first comment a meltdown? Weird.

Trying to make things up that never happened?

reply