3 ms·
It makes sense when compared against flip-flop circuit https://www.geeksforgeeks.org/difference-between-flip-flop-and-latch/ https://www.geeksforgeeks.org/diffe
by zvrba 6y ago
It makes sense when compared against flip-flop circuit https://www.geeksforgeeks.org/difference-between-flip-flop-and-latch/ https://www.geeksforgeeks.org/difference-between-flip-flop-a...
Most importantly, latch is level-triggered, just like the synchronization primitive.
- dataflow 6y ago> It makes sense when compared against flip-flop circuit It doesn't to me... I'm not following unfortunately. Barriers are level-triggered too. Like, physical ones. Push with enough force against a barrier and it'll break down.
- kazinator 6y agolatches can be edge or level triggered. The important concept is that once they are triggered, they latch the input value, and maintain it after the input has disappeared.
- kllrnohj 6y agoThat's what std::latch does... Once triggered it's always triggered. Same as Java's CountDownLatch
- kazinator 6y agoThe thing is, pretty much every object you work with in your programming language latches the most recently stored value in it. The machine is built on latching as a fundamental block. A simple mutex latches open when you unlock it, and then latches locked when something locks it again.
- kllrnohj 6y agoNo, I mean, a std::latch cannot be reset. It's a one-direction one-use toggle. There's no unlocking or relocking. There's no "again" to it.
- kazinator 6y agoLatches can be reset; so bad metaphor on that count also. Something that triggers, flips state and cannot be reset might be called a "fuse". That could work here in another way: since there is a count-down, that's like a dynamite fuse burning.