logoalt Hacker News

Dylan16807today at 5:17 AM1 replyview on HN

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.


Replies

CyberDildonicstoday at 3:49 PM

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.