Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
mehrdadn
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
45 ms
·
391.
▲
by
mehrdadn
6y ago
Regardless of the origins, < is just a more natural operation than >. I kind of mean that both figuratively and literally: the most "natural" numbers are the "natural numbers", which follow 1 < 2 < 3... and n
392.
▲
by
mehrdadn
6y ago
> you can signal on an event from the receiver thread, and it doesn't wake up the waiting threads instantaneously, even if they are waiting on a kernel-level object. This isn't normally the case. You should expect this not to b
393.
▲
by
mehrdadn
6y ago
It "has nothing to do with timing" in the sense that it doesn't let you choose how much delay to incur. It most certainly does "have something to do with timing" in that it lets you do I/O immediately , with
394.
▲
by
mehrdadn
6y ago
I think it's due to my use of APCs like I said. Try replacing SleepEx(100, TRUE) with WaitForSingleObject(handle, INFINITE). Edit: Never mind. Seems it might not be the APCs. Maybe some callee of Sleep(Ex) is just rounding up the wait
395.
▲
by
mehrdadn
6y ago
I think you misunderstood. If you want "timing sensitive processing", that's what you can and should expect to use events or multimedia timers for. That way you can actually expect to meet timing guarantees. Using Sleep() and
396.
▲
by
mehrdadn
6y ago
I see. It's hard to say if I'm missing something but given what I've heard so far I think what you want is I/O completion ports (though there are other ways to solve this). They're basically producer-consumer queues
397.
▲
by
mehrdadn
6y ago
Might be due to my use of APCs rather than waiting on the object. Not bothered enough to try it myself but I guess you can try WaitForSingleObject on the timer to see if it behaves similarly...
398.
▲
by
mehrdadn
6y ago
> I think what you're missing is that all of the overlapped I/O scenarios completions you describe all originate from a hardware interrupt from some device, like a network adapter. The comment literally says "packets came
399.
▲
by
mehrdadn
6y ago
> with no guarantee how often that work was going to appear. But you don't need (and should neither need nor want!) such a guarantee to do this the way I'm saying! It sounds like you might just be unfamiliar with overlapped I&#
400.
▲
by
mehrdadn
6y ago
Try adding timeBeginPeriod(1)/timeEndPeriod(1) around the waitable timer code and you'll see it still wakes up every 16ms.
401.
▲
by
mehrdadn
6y ago
Well I don't know what Windows Server 2016 virtualized on GCP is doing, but if you believe me that I copy-pasted this, you should be wary of making such sweeping claims about Windows... Re: your troubleshooting: wild guess, but one thi
402.
▲
by
mehrdadn
6y ago
Well that's not what I'm seeing... can you paste what you get? > clockres && Temp Maximum timer interval: 15.625 ms Minimum timer interval: 0.500 ms Current timer interval: 15.621 ms 0 15 16 ... 16
403.
▲
by
mehrdadn
6y ago
> what I want to do is "wait until there is more work available to process" If this is merely to free up CPU when you have no work to do, then the actual timing of 1ms vs 16ms doesn't seem like the issue, right? Shouldn&#x
404.
▲
by
mehrdadn
6y ago
> Same issues and resolution affect all of the other mechanisms you mention. Really? On versions prior to 20H2? This gives me 16ms resolution for SetWaitableTimer but 1ms for timeSetEvent: #include <tchar.h> #include <Wind
405.
▲
by
mehrdadn
6y ago
I guess I'm not understanding your use case, if it's not periodic invocation. Why you were calling Sleep(1)? Why was a 16ms sleep problematic in that case?
406.
▲
by
mehrdadn
6y ago
The resolution or behavior of other APIs is beside my point. I'm saying, even if in an ideal world Sleep did wait exactly how much you told it to, I don't get why you would feel justified in using it to trigger something every N m
407.
▲
by
mehrdadn
6y ago
> a different undocumented change brought by Windows 10 version 2004 Any chance you could share this so those of us who haven't dealt with it yet might have a heads-up?
408.
▲
by
mehrdadn
6y ago
I don't even get why you would Sleep() in such a scenario. If you want to fire every 1ms, wouldn't you use an actual timer? Like one of SetTimer/SetThreadpoolTimer/CreateTimerQueueTimer/timeSetEvent/CreateWaita
409.
▲
by
mehrdadn
6y ago
> Before cryptocurrencies were widespread ransomware used vouchers such as PaySafeCard to get paid. Really? You're suggesting this happened on the same scale? So how many hospitals got hacked like this with PaySafeCard? How frequent
410.
▲
by
mehrdadn
6y ago
How long will it be until we realize cryptocurrencies are causing problems?
411.
▲
by
mehrdadn
6y ago
tl;dr is WSL2 is just a VM running under Hyper-V. The host is hence Hyper-V, not Windows.
412.
▲
by
mehrdadn
6y ago
My guess is people are confused because Microsoft has marketed WSL2 as a replacement for WSL1, and it makes sense for WSL1 to go through the Windows firewall, so people assumed WSL2 would behave similarly.
413.
▲
by
mehrdadn
6y ago
The host is the hypervisor though isn't it? Not the Windows inside it.
414.
▲
by
mehrdadn
6y ago
See https://graphics.stanford.edu/~seander/bithacks.html
415.
▲
by
mehrdadn
6y ago
There's a huge difference between mathematical calculations having round-off error and computations that are not mathematical calculations exhibiting something akin to round-off error anyway. It's like giving someone a $10k check
416.
▲
by
mehrdadn
6y ago
I think right now they're like $440,000 [1] which is comparable with cheap helicopters (if not more expensive), but far lower than the average helicopter. [1] https://www.youtube.com/watch?v=EAJM5L9hhBs&t=6m14s
417.
▲
by
mehrdadn
6y ago
I'm guessing it's probably because being just above the ground is something people might refer to as "hovering".
418.
▲
by
mehrdadn
6y ago
Thanks for the info, makes sense! Can I ask where they go over this? I've already read the article and watched the video multiple times but somehow I'm still not seeing where they discuss this.
419.
▲
by
mehrdadn
6y ago
This looks awesome. How does it compare to a helicopter though? Are helicopters not available for these situations?
420.
▲
by
mehrdadn
6y ago
No. Nobody said don't deal with the problem. Nobody said it isn't really a problem either. I'm saying go ahead and deal with the problem as best as you can, privately . If you still can't solve it at the source, then mi
More ›