Skip to main content

A Few Pros and Cons of UNIX

The problem with pros and cons discussions on operating systems, is that the people who need to read them won't, but as the old sage said: Why do you have a mind, if you cannot change it?

USB Support

The Windows device names of USB serial ports keep on changing.  I have seen a machine in our lab using COM57:.  That means that half a hundred times, some poor engineer sat in front of that machine and wondered why on earth his serial port wasn't working.

Trying to deploy a system that uses USB serial ports on Windows is a nightmare, since each and every machine has a different setup and it changes at a whim, so you need to open up low level configuration to the end user and try to explain to him how to change it in the manual and have a technician on standby to support all the users who won't read the manuals.

IT services also like to disable USB mass storage support, since Windows suffers from a 25 year old security bug that Microsoft is unable to fix.  So whenever an engineer captures data on an oscilloscope/network analyzer/ spectrum analyzer/camera system on a USB memory stick, he has no way to view the data on the PC and has to go and find a Linux PC.

Now multiply all that wasted engineering time by all the other Windows machines in your lab.

File Systems

UNIX is a Rosetta Stone of file systems.  It has specialized storage solutions for everything: Large block flash chips, small block flash chips, spinning metal, big files, small files, redundancy, logical volumes, RAID, compression, encryption, snapshots, deduplication...

Windows has only two file systems, NTFS and ReFS.  No, that other one isn't really a file system.

With deduplication on Btrfs or Zfs, if you copy a file, it doesn't use any more disk space.  Just think about that one for a second, go and read up on snapshots and then hold a moment of silence for the Windows users.

Windows NTFS can do deduplication in 32KB chunks on server versions, but it cannot handle large files >200GB.   A large file can cause the whole file system to get corrupted.  So if you need to store video, then you may be out of luck.

Real-Time Operation

Linux has been a real-time OS for more than a decade - since 2002 - fixed by Ingo Molnar while in Calgary, Canada.  On single processor machines, the spin locks compile away.  On multi-processor machines, spin locks are pre-emptable.  The latest Completely Fair Scheduler excels at distributing the work load over the machine cores and it consistently reacts to interrupts in a few microseconds.  BSD and OSX are not bad either.

Windows Vista and 7 have an old fashioned priority scheduler with coarse time slices of 15 ms and slow, non-preemptible interrupt handlers. The result is that whereas an interrupt is usually handled in 10 us, it could sometimes take 500 ms.

Some programs, notably .Net and Chrome, change the Windows 7 time slice to 1 ms, same as on Windows 8 and 10, but it doesn't help significantly.  The Windows debugger and latency measurement tools do not provide an accurate picture, which indicates to me that the tools are starved too and therefore cannot measure time accurately.  This is probably due to contention and non pre-emptable spin locks.  

The Windows scheduler is strictly priority based.  As long as there are processes with a higher priority than yours, then your process will get scheduled ZERO processing time.

Contention and deadlock is handled very inefficiently on Windows.  Processes that are blocked, will periodically have their priority raised to a very high level and will get a big time slice.  This can result in very irregular execution of other time sensitive processes.

.Net has a garbage collector that is really bad on Windows.  When it runs, everything else stops, because the GC runs in the same thread as the main .Net program.  The .Net system is practically single threaded for all the critical stuff and adding more processors with more threads will not improve performance.  This causes bad artifacts when playing real-time video with .Net on a Windows system.

I have observed video playback freezing for 2 seconds, every 8 seconds, on a 4 core with 8 threads machine, after about 3 hours of run time.  MS is working on porting .Net to Mac OSX and Linux, where it should work much better, but it is still early days.

Windows does not handle multiprocessing properly.  Threads stick to the processor core that it first ran on.  When many processes start up and some shut down after a while, the remaining ones will not be redistributed to even the work load.  They even invented a nice sounding name for this mis-feature, called processor affinity, as if that is a good thing.

If your medium priority process is stuck on a core with high priority tasks, then your process will not run, despite there being idle cores, or cores loaded with low priority tasks.

The whole mess is described here: https://msdn.microsoft.com/en-us/library/windows/desktop/ms685100%28v=vs.85%29.aspx

In order to maintain smooth video playback on Windows, you need to maintain very large buffers of 1.5 to 3 seconds.  Therefore, Windows can play streaming television, but it cannot play video from a real-time observation camera with a hand controller properly.

Windows doesn't scale.  Due to the bad scheduler, adding processor cores and memory, does not make a Windows machine significantly faster.  Windows actually runs faster on a 12 core machine, than on a 16 core machine.  UNIX machines do not have this problem and do multiprocessing properly.

Link Aggregation

Windows desktop OS doesn't support more than one ethernet port properly.  To do any 'advanced' routing, you need a server version and support from a third partyAlso note that 'Teaming' doesn't increase your bandwidth, it just creates multiple redundant routes - do not confuse it with Link Aggregation on UNIX.

LAGG and advanced routing is of course a native part of any UNIX/Linux/Mac OS and many (most?) fancy switches and routers actually run Linux.

Mandatory Access Control

Windows by default allows any program to overwrite or delete anything.  This is the reason for the scourge of viruses/malware/macroviruses/ransomware on Windows systems.  Windows Access Control Lists and Mandatory Access Control don't really work.  If it did work, then we would not have these plagues of malware.   

MS Windows is the Street Urchin of computer systems.  An administrator has to scrub his hands up to his elbows after touching a Windows system, to prevent spreading malware infections.

On UNIX systems, there is strong separation between users, administrators, services and application programs and their data of all kinds.  The security configuration is strongest on Red Hat systems with SELinux and Novel systems with App Armor and weakest on Ubuntu, but even Ubuntu doesn't suffer from the MS scabies.

Installation

Linux runs on anything, from embedded computers to super computers.  There are billions of servers, cell phones and routers that run Linux.  It is the most popular OS ever and for many good reasons.  One being ease of installation.

It is a simple matter to make a mirror server with a complete Linux distribution, including all the source code and then install new machines from there, completely automatically, with no user intervention, in about 20 minutes.  After that, you will have a fully functional computer with all the tools and applications that you could possibly want, all set up and ready to go.  This way, you can roll out thousands of computers that will all be configured identically, even if the hardware is not identical, since Linux is smart enough to install the correct device drivers.

Installing Windows is a whole different matter.  There are about 12 different types of Windows, but mainly you need to decide whether you need a server or a desktop.  If you subscribe as a Beta tester, then you can download Windows for free.  Installing it will take a few hours and after that, you will have a completely useless system with no applications to do anything productive.  Well, unless you think that Notepad and Calc are useful and please don't blame me for the spyware.

Cons?

Well, I got to mention one or two, otherwise I have to change the title.

UNIX isn't unfriendly.  It is just very choosy about who exactly its friends are. 

Or as Denis put it:

UNIX is simple and coherent, but it takes a genius (or at any rate, a programmer) to understand and appreciate its simplicity.

Dennis Ritchie (1989) "Unix: A Dialectic".
UNIX can be rather complicated.   You may even have to read a book or three, but once you got it working, it will keep working, it will not get infested with malware, it will not slow down over time and it will be very low maintenance.  I first studied UNIX postgrad in 1985.  It really hasn't changed much since from a user point of view, so the time spent reading books and man pages was a good investment.


. -.-. .-. .- ... . --..  .-.. .  .. -. ..-. .- -- .

Herman

Comments

Popular posts from this blog

Parasitic Quadrifilar Helical Antenna

This article was reprinted in OSCAR News, March 2018:  http://www.amsat-uk.org If you want to receive Satellite Weather Pictures , then you need a decent antenna, otherwise you will receive more noise than picture. For polar orbit satellites, one needs an antenna with a mushroom shaped radiation pattern .  It needs to have strong gain towards the horizon where the satellites are distant, less gain upwards where they are close and as little as possible downwards, which would be wasted and a source of noise.  Most satellites are spin stabilized and therefore the antenna also needs circular polarization, otherwise the received signal will flutter as the antennas rotate through nulls. The helical antenna, first proposed by Kraus in 1948, is the natural solution to circular polarized satellite communications.  It is a simple twisted wire - there seems to be nothing to it.  Various papers have been published on helix antennas, so the operation is pretty well understood. Therefore,

Patch Antenna Design with NEC2

The older free Numerical Electromagnetic Code version 2 (NEC2) from Lawrence Livermore Lab assumes an air dielectric.  This makes it hard (but not impossible) for a radio amateur to experiment with Printed Circuit Board Patch antennas and micro strip lines. Air Spaced Patch Antenna Radiation Pattern You could use the free ASAP simulation program , which handles thin dielectrics, you could shell out a few hundred Dollars for a copy of NEC4 , You could buy GEMACS if you live in the USA, or you could add distributed capacitors to a NEC2 model with LD cards (hook up one capacitor in the middle of each element.), but that is far too much money/trouble for most. More information on driving an array antenna can be found here: https://www.aeronetworks.ca/2019/03/driving-quad-patch-array-antenna.htm l Air Dielectric Patch   The obvious lazy solution is to accept the limitation and make an air dielectric patch antenna. An advantage of using air dielectric, is that the antenn

Weather Satellite Turnstile Antennas for the 2 meter Band

NEC2, 2 m band, 146 MHz, Yagi Turnstile Simulation and Build This article describes a Turnstile Antenna for the 2 meter band, 146 MHz amateur satcom, 137 MHz NOAA and Russian Meteor weather satellites.  Weather satellite reception is described here .  A quadrifilar helical antenna is described here .   Engineering, is the art of making what you need,  from what you can get. Radiation Pattern of the Three Element Yagi-Uda Antenna Once one combine and cross two Yagis, the pattern becomes distinctly twisted. The right hand polarization actually becomes visible in the radiation pattern plot, which I found really cool. Radiation Pattern of Six Element Turnstile Antenna Only a true RF Geek can appreciate the twisted invisible inner beauty of a herring bone antenna... Six Element Turnstile Antenna Essentially, it is three crosses on a stick.  The driven elements are broken in the middle at the drive points.  The other elements can go straight throug