Re: [ntdev] kcalloc equivalent

IMHO the upper bound of performance of algorithms for parallel processing depends greatly on the problem you are trying to solve. Some can be O(n) - C and others actually scale negatively

Sent from Surface Pro

From: Sinha Prokash
Sent: ‎Sunday‎, ‎April‎ ‎19‎, ‎2015 ‎11‎:‎55‎ ‎AM
To: Windows System Software Devs Interest List


In around year 2000, the industry saw a physical barrier, and came up with multi-core hyper threaded HW. So the obvious question was how to get parallel / concurrent computing much easier ?

We know from theoretical point of view is the maximum we get is for an O(n) processing is O(log(n) ). Now not bad even it is not asymptotically stable. It is still at a very lower pace than O(n). – Okay we can live with that:-)

Language side joined the party too ! OpenCL for one and Grand central Dispatch is another one, among others.

C++ is already in the plug able kernel module infrastructures already …

When it comes down to Kernel here is what I like most -

“If you put a spoonful of sewage in a barrel of wine, you get a barrel full of sewage.”

On few occasion I’ve seen people changed the core kernel, and subtle bug appeared after a year or so. These are kernel locking, panic and other like those. Personally I think a leaner language C helped understand, albeit long hacking/debugging of the problems. So that’s called learned the hard way what to appreciate and what not too given a certain context.

For large scale systems programming ( not in kernel ), people have been using C++ mainly because of its similarity with C but lot of pitfalls can be avoided easily as well as for better interface design.

Pro

Date: Sun, 19 Apr 2015 07:55:15 -0400
From: xxxxx@hotmail.com
To: xxxxx@lists.osr.com
Subject: RE:[ntdev] kcalloc equivalent

> You know, I was going to make fun of the idea that binary literals as a language addition was
> such a big idea. But, the more I thought about it, the more I really can’t wait to use it.

Well, if you think even more about it you will realize how cumbersome and error-prone this idea is for driver writers and OS designers, i.e for those .who normally have to deal with 32-bit and/or 64-bit registers. For the fun of doing it, try writing a bit of Verilog code, so you will see that the approach that may brilliant for handling 4-bit values becomes somewhat cumbersome with 16-bit ones and totally messy with 32-bit, let alone 64-bit ones. I guess they took this idea from the world of HDLs, especially taking into account that C++ -like languages may be used for hardware simulations (i.e so-called System C)

>I just recently learned about range-for…

Again, the same story - this feature is of particular use for hardware designers who may want to
have their internal registers of"non-standard" size( like 5-bit, for example), as well as to access individual bits in the middle of the range. However, if you use it in context of software
development - well, it seems to be something Ada-inspired…

Concerning Sven’s examples of timing prefixes, although this feature may be, indeed, somewhat/sometimes useful for the software designers, it still seems to be of particular use for hardware ones, because timing is of vital importance for hardware simulations…

In other words, all these extensions seem to target hardware designers, rather than kernel developers…

Anton Bassov


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Please don’t get me started on C# lambda expressions. As a supervisor of code reviewers, these seem to cause only slightly less utter slack jawed confusion than overloaded operators. You wouldn’t think so as the concept is not hard, but this was hardly the first time I have been surprised

Sent from Surface Pro

From: Tim Roberts
Sent: ‎Monday‎, ‎April‎ ‎20‎, ‎2015 ‎6‎:‎42‎ ‎PM
To: Windows System Software Devs Interest List

xxxxx@osr.com wrote:

Of course, much stuff in std:: suffers from the usual “It’s sooooo ugly and hard to parse visually” disease that defines C++. I mean, SERIOUSLY… WTF is THIS:

std::future f1 = std::async(std::launch::async, {
> return fib(20);
> });
>
> (and please, nobody bother to explain it to me. I know what it does. I just can’t believe anybody could actually invent anything so fucking ridiculously ugly. Note particularly the “{” sequence.).

I have a certain amount of sympathy. They had to introduce an entirely
new syntax element here. It would have been nice to introduce a new
keyword (lambda?), but that would break all kinds of existing code. The
C# lambda sequence is only slightly better, but it doesn’t support all
of the closure cases.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

I would argue that an abstraction that is cross-platform is a stronger abstraction than one confined to a specific platform. You are right of course that an abstraction on a platform is vastly better than none at all

Sent from Surface Pro

From: xxxxx@osr.com
Sent: ‎Tuesday‎, ‎April‎ ‎21‎, ‎2015 ‎5‎:‎58‎ ‎PM
To: Windows System Software Devs Interest List

We have a very different definition of what “abstracted” time units mean then. “Abstracted” does not equal – and has no relation to I would argue – “cross-platform compatible.”

100ns units is the abstract and universal unit of time in the Windows kernel, in that is it the same across all Windows platforms and versions. It is NOT like “clock ticks”, which vary depending on the platform and/or version of the system. I remember those hassles from other platforms… “Which clock is in this system, and what is its frequency.” Very annoying.

So, yes… 100ns is the standard “abstract” unit of time on Windows… regardless of the clock tick. They COULD have chosen milliseconds. They COULD have chosen femptoseconds. But they chose 100ns units.

Peter
OSR
@OSRDrivers


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

IMHO it is much easier to simply define the non-obvious MACRO while(true) to eliminate the warnings; but then I am irrationally prejudiced against for loops (except the .NET for each next kind)

The more annoying problem is casting function pointers because the signatures differ by const qualifiers. Generic function pointer types don’t include them, but often the actual function definition does and that causes a type mismatch. It seems wrong that the compiler should complain when a callee enforces a more rigorous contract than a caller demands

Sent from Surface Pro

From: Maxim S. Shatskih
Sent: ‎Friday‎, ‎April‎ ‎24‎, ‎2015 ‎6‎:‎25‎ ‎PM
To: Windows System Software Devs Interest List

I was pleased to see that the WDK defaults /W4. Many devs simply find /W4 too cantankerous to
deal with.

I think /W4 /WX is a must beyound doubt, even if some stuff from it should be suppressed by #pragmas.

The Greek-like word of “cantankerous”, looking like a Bysantine emperor family name, surely enriches my English knowledge :slight_smile:

Unreferenced parameters,

So what? C has no C++ elegant way of dealing with them, but it has UNREFERENCED_PARAMETER() macro.

and invariant expressions in a “while” statement

Use for(;:wink: instead.


Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Depending on how imported and invented words are classified in your dictionary of choice, English has between 100-200 thousand lexemes; of which most native English speakers are fluent in approximately 20-30 thousand.

Putting aside the content of the works, Gibbon is undoubtedly a great author, but any of Milton’s works are more linguistically complex. And further, look for translations from the Greek by Edward Pope; even F. Scott Fitzgerald is more erudite IMHO

After writing this far, I recollect myself and before proceeding further rediscover the fact that this is a technical form and not a book club - however much I am tempted to proceed with another diatribe

Sent from Surface Pro

From: Jamey Kirby
Sent: ‎Sunday‎, ‎April‎ ‎26‎, ‎2015 ‎2‎:‎37‎ ‎PM
To: Windows System Software Devs Interest List

I digress:

I have been reading Edward Gibbon’s “The History of The Decline and Fall of the Roman Empire” for nearly three years now. It is the definition of a tome. When I started, I committed to reading the entire text and all of the footnotes; just over 4,000 pages. Even if classical history does not interest you, in my opinion, it is one of the finest texts ever written in the English language. Your understanding of the language and your vocabulary will increase by leaps and bounds from reading this book. I recommend it for both native and non-native English speakers. You will not regret having read it. There are free Kindle versions as well as paid Kindle versions. I think I have three version.

http://en.wikipedia.org/wiki/The_History_of_the_Decline_and_Fall_of_the_Roman_Empire

On Sat, Apr 25, 2015 at 8:39 PM, wrote:

>> A lot of surprising reactions but wow, I could never have imagined Max calling
something about c++ elegant.

> I worked with this language for the most of 1990ies.



>>Generic function pointer types

> There is no such thing neither in C nor in C++, unless you’re speaking on some
> arcane Boost templates like lambdas etc.

This reminds me of one of the books on advanced use of C++ that I had read around 17 years ago
In fact, this book was, IIRC, almost completely dedicated to generic functions, aka function templates (not to be confused with “generic” C++ keyword which, indeed, seems to be one of more recent developments - https://msdn.microsoft.com/en-us/library/ssea4yk6.aspx).According to this book, one of the main prerequisites of becoming a good C++programmer is a complete lack of any prior exposure to C, because a good C programmer is more than likely to make an awful C++ one.
I immediately recalled what this books says about C programmers when I saw your statements about generic functions - you don’t seem to even know what they are, despite having programmed in C++ for years…

> The Greek-like word of “cantankerous”, looking like a Bysantine emperor family
> name, surely enriches my English knowledge :slight_smile:

Indeed, this word does not seem to be among the ones that you encounter every other day
(I think this is the third time I come across this word in my entire life). There are quite a few words like that in English language. For example, the words like “compunctions” or “rancour” seem to be used even less frequently than that (I don’t think I had encountered them more than once). OK, we are foreigners so that we cannot really make a proper judgement, but some English words are not necessarily going to be understood by native speakers either. For example, the word “defenestration” was apparently unfamiliar to Mr.Little, although he believes English is his mother tongue…

Anton Bassov


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer



Jamey Kirby
Disrupting the establishment since 1964

This is a personal email account and as such, emails are not subject to archiving. Nothing else really matters.
— NTDEV is sponsored by OSR Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev OSR is HIRING!! See http://www.osr.com/careers For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer