Posted by jpluimers on 2017/12/12
Cool: [WayBack] Scalable spinlocks 1: array-based | The Infinite Loop
Last time we saw that spinlock implementations which only use a single synchronization variable (Test-And-Set Lock, Ticket Lock) don’t scale with growing numbers of threads. Today, I want to talk about two spinlock variants that scale. Namely the Graunke and Thakkar Lock1 (1989) and the Anderson Lock2 (1990). Their underlying key idea is to use one synchronization variable per thread instead of one for all threads, to reduce the amount of cache line invalidations when acquiring/releasing the lock. Both spinlock variants store the synchronization variables in an array. This means that there’s an upper bound on the maximum number of thread’s that can compete for the lock concurrently, which must be known a priori. In upcoming blog posts I’m going to show spinlock variants (the MCS Lock and the CLH Lock) that improve upon array-based spinlocks by removing this hard upper limit.
–jeroen
via: [WayBack] Scalable spinlocks 1: array-based | The Infinite Loop – David Berneda – Google+
Posted in Algorithms, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2017/12/12
LINQ is certainly extraordinarily useful. It brings the power of query expressions to C#, allowing an easy way of getting the data you need from a variety of data sources. Up to now, there hasn’t been a VS debugger for LINQ that gives you the means to visualise the data at every point in the chain. Michael Sorens, a keen LINQ user, describes a third-party tool that now promises to make using LINQ something we can all participate in.…
Great read. [WayBack] LINQ Debugging and Visualization – Simple Talk
Via: [WayBack] LINQ Debugging and Visualisation – Jeroen Wiert Pluimers – Google+
–jeroen
Posted in .NET, Development, LINQ, Software Development | Leave a Comment »
Posted by jpluimers on 2017/12/11
I while ago I had the error “error accessing the registry” while importing.
In my case I had escaped too many back-slashes. Not just the file names in the values, also the registry key names.
So I had key names like this:
[HKEY_CURRENT_USER\\Software]
That fails, but the error won’t tell you why. The key needs to be this:
[HKEY_CURRENT_USER\Software]
BTW: you do not need regedit.exe to import as reg.exe can do the same: [WayBack] How to add a .REG file to your Registry silently – Scott Hanselman
–jeroen
Posted in Development, Registry Files, Scripting, Software Development | Leave a Comment »
Posted by jpluimers on 2017/12/11
schtasks /End [/S <system> [/U <username> [/P [<password>]]]] /TN taskname
[WayBack] End a Running Task
Every now and then you have those Scheduled Tasks consisting of batch files that – despite trying – still ask for user input.
If – even after a reasonable time out – the Task Scheduler still hasn’t killed them, you can kill them by hand with the above schtasks in a snap.
–jeroen
Posted in Console (command prompt window), Power User, Windows, Windows 10, Windows 7, Windows 8, Windows 8.1, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server 2016 | Leave a Comment »
Posted by jpluimers on 2017/12/07
Since I’m in a C mood today: Free book: [WayBack] Writing Bug-Free C Code, A Programming Style That Automatically Detects Bugs in C Codeby Jerry Jongerius / January 1995.
Be sure to credit the author.
Via: [WayBack] Writing Bug-Free C Code A Programming Style That Automatically Detects Bugs in C Codeby Jerry Jongerius / January 1995 – Ilya S – Google+
–jeroen
Posted in C, Development, Software Development | 1 Comment »
Posted by jpluimers on 2017/12/07
Ah, C. The best lingua franca we have… because we have no other lingua francas. Linguae franca. Surgeons general? C is fairly old — 44 years, now! — and comes from a time when there were possibly more architectures than programming languages. It works well for what it is, and what it is is a relatively simple layer of indirection atop assembly. Alas, the popularity of C has led to a number of programming languages’ taking significant cues from its design, and parts of its design are… slightly questionable. I’ve gone through some common features that probably should’ve stayed in C and my justification for saying so. The features are listed in rough order from (I hope) least to most controversial. The idea is that C fans will give up when I call it “weakly typed” and not even get to the part where I rag on braces. Wait, crap, I gave it away.
Great re-read towards the end of the year: [WayBack] Let’s stop copying C / fuzzy notepad
Via: [WayBack] Old and busted: emacs vs vi. New and hot: Language war, everybody against everybody else. – Kristian Köhntopp – Google+
–jeroen
Posted in .NET, APL, Awk, bash, BASIC, C, C#, C++, COBOL, CoffeeScript, CommandLine, D, Delphi, Development, F#, Fortran, Go (golang), Java, Java Platform, JavaScript/ECMAScript, Pascal, Perl, PHP, PowerShell, PowerShell, Python, Ruby, Scala, Scripting, Software Development, TypeScript, VB.NET, VBScript | 3 Comments »
Posted by jpluimers on 2017/12/06
Oh nice. Feel free to QP. Fails at least in Delphi XE8.
program E2003WithConstsInDescendingClassesConsoleProject;
{$APPTYPE CONSOLE}
uses
ParentUnit in 'ParentUnit.pas',
ChildUnit in 'ChildUnit.pas';
begin
end.
unit ParentUnit;
interface
type
TParent = class
// section can be strict protected, protected, public, published or nothing
const
InitialBooleanValue = False;
InitialIntegerValue = -1;
end;
implementation
end.
unit ChildUnit;
interface
uses
ParentUnit;
type
TChild = class(TParent)
// section can be strict protected, protected, public, published or nothing
const
// Initial and final values need to be different to test the behaviour
FinalBooleanValue = not InitialBooleanValue;
FinalIntegerValue = InitialIntegerValue + 1;
//[dcc32 Error] ChildUnit.pas(13): E2003 Undeclared identifier: 'InitialBooleanValue'
//[dcc32 Error] ChildUnit.pas(14): E2003 Undeclared identifier: 'InitialIntegerValue'
//[dcc32 Error] ChildUnit.pas(14): E2026 Constant expression expected
end;
implementation
end.
[WayBack] Oh nice. Feel free to QP. unit ParentUnit; interface type TParent = class …
Posted in Delphi, Delphi XE8, Development, Software Development | 3 Comments »