4 ms·
The case of the vector with an impossibly large size
- mgaunard 3y agoIt's interesting that people have such trivial problems with their C++ code and still manage to get an expert from Microsoft to look at it for them. Also what I find interesting is that modern tools like sanitizers would quickly say what's going on without needing any human analysis.
- jdthedisciple 3y agoIt's Raymond Chen. It's not that the customer deserves Raymond Chen. Not even HN deserves Raymond Chen. It's just that Raymond Chen is once again gracing us with his vast and deep insights. Legend.
- trashburger 3y agoThe fix is kind of weird, no? If the lazy initialization of the widgets fail, won't it stay stuck as failed forever (i.e. until the containing class is destroyed)? Is this intended behavior?
- tallanvor 3y agoNo, at least not if exceptions are propagated properly. The flag that determines if call_once should actually run or not doesn't get flipped if there's an exception.
- vsnf 3y agoA favorite past-time of HN when a post with an interesting title on the microsoft.com domain appears, is to guess whether it's Raymond Chen, and then to fawn over Raymond Chen. All very well deserved, but are there any examples of interesting posts on microsoft.com from someone who isn't Raymond Chen discussed here?
- doesnt_know 3y agoIt’s a pretty easy guess at this point since there isn’t much else of value published on that domain.
- mapreduce 3y agoThe MSDN documents on the website have been invaluable to me. I mean I started by writing chat tools on Windows and their API docs have been excellent in getting me started. I mean stuff like https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getwindow https://learn.microsoft.com/en-us/windows/win32/api/winuser/... I cannot understand why you think such a large website with so much documentation is of no value!
- cylemons 3y agoValue in the context of Hacker News means something that is amusing, insightful, or impressive. It is very rare for plain ol' documentation to make it to the front page.
- taspeotis 3y agoEric Lippert used to publish some good stuff, and Michael Kaplan. Occasionally there is decent technical content from the SQL Server team [1]. [1] https://cloudblogs.microsoft.com/sqlserver/2022/07/21/improve-scalability-with-system-page-latch-concurrency-enhancements-in-sql-server-2022/ https://cloudblogs.microsoft.com/sqlserver/2022/07/21/improv...
- lifthrasiir 3y agoNote that Michael Kaplan's original blog ceased to exist after he died and MS "renewed" MSDN blogs, but the archive is still available [1]. [1] https://archives.miloush.net/michkap/archive/ https://archives.miloush.net/michkap/archive/
- deleted 3y ago[deleted]
- physicsguy 3y agoI've been out of C++ for a couple of years now, but std::call_once is totally new to me, despite being in C++11. It really is a language where if you got 5 different people to write a solution to something you'd get 5 wildly different answers.
- tialaramex 3y agoSix, at least. Also at least one of the answers the five people swear they use will turn out to be either Undefined Behaviour or a quirk of one particular compiler/ toolchain. Like sure, volatile integers are basically just atomic variables with easier syntax... if you are on x86-64 and using MSVC. Otherwise no they really aren't.
- mihaaly 3y agoA nice, related meme: https://mikelui.io/img/c++_init_forest.gif https://mikelui.io/img/c++_init_forest.gif
- tialaramex 3y agoAnd on that subject https://leanpub.com/cppinitbook https://leanpub.com/cppinitbook - a book just about initialization in C++ which is in some sense (more pages) longer than my edition of K&R ("The C Programming Language"). Despite all this complexity, C++ 23 has problems with mistakenly uninitialized variables and still lacks a coherent strategy to do deferred initialization correctly.
- classified 3y agoThat GIF should mention the relevant C++ standard, because next year there will be at least one more additional way to initialize.
- moralestapia 3y agoI consider that a feature tho.
- tiagod 3y ago
- davikr 3y agoIs it habitual for Microsoft to help their customers like this? Is there some kind of support or consultancy contract for it?
- tallanvor 3y agoMicrosoft has probably the largest support organization of any software company. A lot of it is outsourced support that mostly runs through support trees, but enterprises can and do pay for support from actual employees who can actually debug issues and involve developers when needed.
- gnarlouse 3y agoI missed it. How big was the vector
- WesSouza 3y agoIt’s never lupus. It’s always race conditions.