Work getting done


Coded all day.

Have the new test and benchmark app to the point it compiles.

Still need to do some key work, but it’s an important step.

Importantly, I realised I’d made a huge blunder all along in test and benchmark – I use in test and in benchmark liblfds data structures, the list in particular.

I can’t do that, because liblfds is designed to offer data structures to the extent your system offers atomics; so you might not *have* the list.

In fact, the test and benchmark code needs to use single threaded data structures throughout.

This means I need to put some of the single-threaded data structure (stds) library data structures in the test and benchmark library.

I also need to introduce versioning on the stds code in liblfds, so multiple released can be compiled in the same project.

I finish my current contract work on Tuesday, and I’ll be taking a few years off, so the next release will come reasonable soon – few months tops.

Booking flights, again and again and again and…

I’m trying to book a flight.

For as far back now as I can remember I have never, *never* been able to book on the first attempt – i.e. filling in all the forms *just once*.

I tried just now to book with BA.

Economy, but there’s real economy and “slightly more” economy, where you pay an extra 10 UKP and get one luggage and pick a seat.

I never want to pick a seat and I’ve always found the price of all the extra when I only want some to be less than buying them directly.

BA do *not* provide any information on how much the extras cost by themselves

I booked.

It rejected my card – told me it was not a personal card.

I changed it to business.

It then added a 62 pence surcharge for it being a credit card, which it is not.

I booked. I was rather unsure because it *looked* like you could not add bags *at all*, but I Googled and it is apparently something you do after.

So I booked, and went to add luggage.

30 GBP to have one more.


*90* GBP for two more.

Not okay and extremely surprising.

It’s only 11 GBP to have to “slightly more” ticket, which comes with a luggage.

I want to change my ticket.

You can’t.

I now need to cancel my ticket, which I do.

Fortunately I can do it on-line myself – I say fortunately because there’s no on-line chat, only a phone number which costs more than 1 euro a minute to call if you’re using VOIP (which I am, since I make almost no calls and don’t want a 12 month phone line contract).

The surcharge for using a credit card is not refunded.

I’m now going to book for the third time.

Fuck me.

I mean there’s enough fucking forms anyway and they’re awful to fill out but the place I’m at I’d be dying just to fill them all out ONCE.

Airlines -> you stink. All of you. Completely fucking incompetent at web-sites.

It’s not even the question of whether you’ve managed to make a nice site so booking is easy : it’s a question of HOW MANY TIMES I NEED TO REPEAT BOOKING BEFORE I CAN MAKE IT WORK.

I can’t find out from Googling what the price of extra luggage is if you have the “slightly more” ticket, so I’m going to book for the third time *just to find out*.

Fuck me.

Airlines. Desperately in need of competition.


Booked, third time.



Fucking Christ.

I’m practically crying.

If you can think of a totally obvious way in which it can be utterlly bollocksed up – THAT’S WHAT WILL HAPPEN.

“Hmm. I need to add more luggage to my ticket. What possible problem could be the worst thing that could happen? I know – there’s no way to add luggage!”

“What happened?”

“I bought the ticket and there was no way to add luggage.”

I’m writing it like it’s a joke BUT IT’S WHAT ACTUALLY HAPPENS.

Who the *fuck* makes these web-sites?

Who hires these people?

Who are their MANAGERS?

Who hire these fucking retard managers??!


The UK has issued a white paper.

It doesn’t work; it cherry picks and requires the EU to accept a customs arrangement which is harmful to them, and, profoundly, it does not solve the NI problem.

The PM has given up trying to solve the NI problem, as she should, because it cannot be solved within the constraints in operation : she has now asked the EU to change their requirements for NI, which is properly tantamount to asking Southern Ireland and EU to accept an open border with a third country.

This will never happen.

The Conservatives have already crossed the line such that their vote has split; they’ve lost 5% overnight, the UKIP have gained 5%.

Now, what it comes down to is this : the UK Government cannot present any plan which will command a majority. A hard Brexit will be blocked, a soft Brexit will be blocked. Neither approach solves the NI problem.

So now what?

Now the UK either crashes out with no deal, or, second referendum. I’d like to see a third option – rescind exiting until the Government has an accepted plan for leaving.

I read what I think was an perceptive comment about the whole matter : article 50 was triggered immediately after the referendum, when it should have been triggered only after a plan for leaving had been agreed.

It’s like selling your house before you’ve bought the next one.

My personal view is that with bureaucracy, the worst possible choice is *always* taken, and so it will be no deal.

If you hold Sterling, I advise you to change to a safe-haven currency, because a no deal exit will lop off probably 10% to 20% of the value of your currency holdings.

Disclosure : I now hold no Sterling. Most of my wealth is in Swiss Francs.

Brexit / Second Referendum

The Conservative Party has failed to produce a viable hard Brexit plan, because it is impossible.

A softer plan has emerged and the key hard exit politicians have resigned.

The consequence of this is that the Conservative vote has split. They were equal with Labour, now they’re five points behind, because the UKIP vote has increased overnight by five points.

The Conservatives only hope now is that come an election, UKIP voters will actually vote Conservative, because if they do not, Labour will get in.

So the question now is simply what can the Conservatives do to try to UKIP voters on-side come an election?

I think on the whole this means no second referendum.

The people who want this are people who wanted to remain. The exiters are very happy with it because it gave them what they want. They will not be happy with a second referendum.

A second referendum now would vote to stay in the EU, mainly because the old and rich voted to leave and after two years of them dying and two years of younger voters getting older and so obtaining the vote, the balance has shifted.

The basis to argue for a second referendum is that people were misinformed in the first; it’s only now they can make a genuinely informed choice.

In fact, I don’t think people’s views have changed at all; actual information is not part of the debate. It’s an emotional matter. The vote outcome will change because of the change in the voting population by the passage of two years.


I think Trump will take the USA out of NATO; if not today, if not at this summit, as soon as he can. He is preparing the ground.

This has begun with his current claims, that Germany is completely controlled by Russia.

The purpose of this is to devalue the alliance with Germany (through NATO). If Germany is already subverted, what point is there being in alliance with them?

So, when Europe is composed of individual States with their own armies you sooner or later get war. Maybe not in our lifetime, but certainly for our children, and war now means war in a world with widespread nuclear weapons.

When there is a pan-European war, the USA gets involved. It happened in WW2 and it happened in WW1. This leads to many hundreds of thousands or millions of American deaths. US Presidents until now have been wise enough to know that it is infinitely better and cheaper to station troops in Europe and so prevent war, than to remove them and then have war; Europe and the far east centered upon Japan constitute along with the USA the First World, and the USA ultimately benefits so profoundly from the First World that it acts, our of self-interest, to preserve the First World. This has post-war been achieved by the US alliance with Germany through NATO) and with Japan.

(US troops prevent war in Europe by being part of NATO, and if you attack anyone in NATO, you attack all of NATO, and the USA has massive military power. So it hasn’t happened, and Europe has had a very long period of peace. So much so in fact I think people have forgotten that war is the normal, default state of affairs and peace is something which only happens when efforts are taken to stabilize matters.)

Trump is going to lead the USA out of NATO.

This is happening because Trump is above his ceiling. When a man is above his ceiling, he continues to operate in his new role as he did in his old role. Trump is running the USA as if it were a hotel chain; he is also I judge from what I read of his conduct to his staff authoritarian. Authoritarian leaders are so because of insecurity, and this leads them to hire weak and submissive staff, always, as such people form no threat or competition and can be dominated. This we have seen the departure of all those around Trump who are capable and strong, being replaced with the weak and submissive. This is also why Trump is so single-minded about loyalty; if you are insecure, you need blind loyalty to reassure you, as you’re sure you’re no good but can’t stand to think other people will know it or think it.

I may be wrong, but I think Trump sees NATO only as a cost, and the whole situation as unjust (as the insecure tend to), as the USA spends and NATO does not. Beyond this, he sees not. I doubt he knows much history, or reads much. (I must say that I do not expect the USA to reduce its spending when it leaves NATO.) I also have some vague wonderment about the relationship between Trump and Russia. What *is* going on there? Trump doing a great deal which supports and encourages Putin’s goals. It is purely co-incidence? I think so, but I am maybe oh 5% not sure, and I tend to see Russian influence in a lot that happens – Russia historically has always been expansionist, and I think it the same now. You have to think that the mass of Russian people are conditioned into a world view which condones that which Putin does; the Russian people *believe and support*. I expect to find Russian money making its way into the hands of those who are acting to destabilize the EU and the West; it happened for the last hundred years. Why would it stop now?

The NATO States, knowing it is in the best interest of the USA to keep troops in the EU, have not spent enough on defence. The UK and France have spent barely enough, they have a long military history and so culturally are inclined to at least spend something, the Germans have spent very little because they are inculcated with war guilt and do not like military spending. The Italians have not spent enough because their economy is regulated to death so they cannot afford it, the Spanish have not spent enough, but here I cannot say why. Turkey spends a lot, but has never moved on from more direct forms of dictatorship, overt or covert, and currently has departed from the Western sphere. The other States are small players.

This provides a possibility of failure where a populist comes to power in the USA and removes the USA from NATO. Populism has arisen in the USA because the body politic is understood by the mass of people to be corrupt and foul, but they do not understand why, nor what ought to be done, for the mass of people in all countries have for centuries been brought up and conditioned from birth not to think but to simply accept the State as right, and so people are utterly open to manipulative populism; they have no framework of concepts of their own of what is right or wrong, or the mental defences or capability to detect something which is bogus. In short, people have been raised to be gullable and naive, to be obedident to the State, and so they are vulnerable to deception.

(The basic ethical rule is that everything two entities – individial, business, State, anything – do together, must be voluntary and well-informed, except in self-defence. You cannot force others to do things, nor trick them into it, unless you act in self-defence. Almost everything State does violates this principle, taxation for example.)

But NATO still exists, and if defence spending rises and it becomes a credible force, that will keep Europe from being a collection of individual States with their own armies, which will lead sooner or later to a pan-European war, in a world with widespread nuclear weapons.

The EU also helps in this matter, as it has acted to pull the individual States together into something more like a single entity.

The problem here though is that the EU is going to fail. You cannot have economic union without political union, and there is not enough political union. When the economy part falls over, the political part will be profoundly weakened. (There have been sixteeen currency unions in history. Eight ended when the States involved merged, the other eight failed.)

So all we have between us and individual States with their own armies is NATO, and Trump is weakening it by taking the USA out.

The EU I think will end up weakening NATO as well, as it is now that the Brits are out calling for an EU military. The Brits always flatly blocked this, citing NATO as the combined military force. The problem with the EU assumining a military role is that when it collapses, the military as with the econonmy will re-nationalize. So it doesn’t work – attaching the military the EU will lead to its fragmention when the EU fails, and then we’re back to individual States. NATO is the right solution in that sense.

Looking over the US web-sites, I see for example Fox news (which seems to be a Trump mouthpiece) asserting NATO is obsolete.

My experience of people is that if you imagine the most destructive, self-destructive, staggeringly horrific and utterly incomprehensible act – something really beyond imagination – like moving the world toward a war where millions in appalling agony, along with the chance of nuclear exchanges, where the ecological damage will devastate the planet globally even if the nuclear explosions do not do so directly – you will find tons of people calling for it and huge numbers of people thinking its a good idea and wanting it to happen.

Plenty of people are evil, and plenty of people are gullable and naive. The former is human nature, the latter is that the mass of people have been raised to be gullable and naive, to be obedient to the State, and so they are vulnerable to deception.

So all in all, NATO is our hope.


I think Donald Trump will bring the USA out of NATO, or at least eliminate the US troop presence in Europe.

When Europe goes to war, the USA gets involved.

With nuclear weapons now widely fielded, any large scale war contains risks of a magnitude and type which never before have existed.

I rather think people have become so accustomed to peace they think not of it and assume it will always been so.

The USA has maintained an alliance with Germany (via NATO) for the last seventy years to ensure peace in Europe, so that the USA never has to be involved in the European war.

The EU States have been reckless with this American aid, and spent almost nothing on their own defense.

Now out of the blue a populist, out of his depth, ascends to the Presidency and the USA acts in ways profoundly against its own interest; and this all comes out of the blue, an utter surprise, to an EU lacking so very much in the way of its military strength.

Thank God the Brits and French held on to their own nuclear weapons.

So, the USA will leave, and Europe will need to arm itself, as it should have done (although Trump would have left anyway, I think : some other reason would have been found).

I hope Europe will arm itself through NATO, and if not NATO, then through the EU; the Germans do not want an army, because of how they feel about their past, and if each nation has its own army outside of the EU, then we are back to where we were before, with a range of nations in Europe, and sooner or later, conflict and war.

States can fight, so sooner or later they do.

Europe needs to federate.

Military unification must however be preceded by political integration, just as economic unification must be preceded by political union.

The EU I think is not unified enough politically to support economic or military union, and so when that unification unravels (as it is not complete and not sound), the military will nationialize – as happened in the Soviet Union – and we will be back to where we started, with a range of nations in Europe and sooner or later, conflict and war.

The road to hell is paved with affinity APIs

I’m working away on the new test and benchmark application.

I need to support creating processes, to test position-independent data structures.

That means I need to pin processes to particular logical cores.

Know what?

That’s what’s written on the sign that points the way into hell.

Let me put this bluntly : Windows has no API to set process affinity beyond the first processor group, which has a maximum of 64 logical cores.

You read that right.

So if you have say 128 cores, and let’s say Windows has split these up into two 64 core groups – you can only set process affinity to be on cores 0 to 63.

You *can* set *thread* affinity to be on any core – but this is *not the same* as process affinity, and is less performant – but it looks like this is the best you can do.

It’s problematic to do this remotely (from another process). To do so you’d need to call CreateRemoteThreadEx(). In my case, I’m spawning new processes and I want them to quit when the benchmark work is done, so I need to co-ordinate between the main thread (which begins when the process is spawned) and the thread created by CreateRemoteThreadEx(), which will be created at some point after the main thread… it’s hard to wait on things in the main thread which haven’t yet been created. I could busy wait on a global variable…. but this is stomach-twistingly bad. I don’t *want* to write code like this.

You can set thread affinity from within the process itself by calling SetThreadGroupAffinity(). Obviously to use this you have to pass in information about which logical core in which processor group. I’m passing in some information already to the child process, through the command line (shared memory name and length in bytes), so I’ll have to add this.

It’s still not what I actually want. I want to set process affinity, from the parent process.

Windows thread/process affinity APIs are Civil Service quality – and I don’t mean the British Civil Service. I mean the *Egyptian* Civil Service.

Next step, finding out how bad it is under Linux. It’ll be bad, but it won’t be as bad, even if it’s just by not having processor groups, which are the worst single concept I’ve encountered since MS-DOS was designed with a 640kb RAM limit.