Why Computers Can't Count Sometimes

  • Published on Nov 12, 2018
  • Sometimes, numbers on sites like TVclip and Twitter jump up and down; subscriber counts lag, like-counts bounce all over the place. Why is it so hard for computers to count? To answer that, we need to talk about threading, eventual consistency, and caching.
    Thanks to my proofreading team, and to Tomek on camera!
    The Cambridge Centre for Computing History: www.computinghistory.org.uk/
    I'm at tomscott.com
    on Twitter at twitter.com/tomscott
    on Facebook at facebook.com/tomscott
    and on Instagram as tomscottgo

Comments • 1 268

  • Tom Scott
    Tom Scott  27 days ago +2206

    This was a really difficult script to write! Folks who know 'eventual consistency' as a more formal term may be annoyed that I'm using it a bit loosely here. Hopefully this works as an explainer for folks who are new to it, though!

    • Erkin Alp Güney
      Erkin Alp Güney 21 day ago

      @Tom Scott you will also need to wait for the queue to clear to be able to upload a new video.

    • TheFcukinBest
      TheFcukinBest 24 days ago

      0.50 s

    • plasmaburndeath
      plasmaburndeath 25 days ago

      Ty for explaining how this works for the trolls who always scream "this video is 40 minutes old why are there 1,000 likes for 35 minute video and only 200 views" so on

    • Eastevan GER_TW
      Eastevan GER_TW 25 days ago

      hey tom is the 1701 you choose only a coincidence? thats my personal way to find out if the person in front of realy is a nerd :)

    • Jonas Thörnvall
      Jonas Thörnvall 25 days ago

      Yeah the example seem a bit contrieved there is no reason for the one who put a like onto a video to retrieve the accumulated sum and add to it, it just would send the message "liked" and the backend server add one?
      Or is there a reason it is done at the clientside "within example"?

  • Jacob Saunders
    Jacob Saunders Day ago

    i just came here to say 69

  • Dylan Kirdahy
    Dylan Kirdahy Day ago

    Really informative, thanks!

  • despacito2
    despacito2 2 days ago

    this guy looks young and old at the same time

  • iamthinking2202 _
    iamthinking2202 _ 4 days ago

    Would this be why people use other sites like socialblade or some live subscriber count instead of simply just checking their channel homepage when they want to see if they hit 1M?

  • philthedirector
    philthedirector 4 days ago

    His mannerisms and voice remind me of nick clegg!

  • Haywire TV Digital
    Haywire TV Digital 6 days ago

    Toms an absolute pro at hand gestures

  • myungskywalker
    myungskywalker 6 days ago

    Please do some shoulder exercises and get a buzz cut. Love ur videos.

  • Victoria
    Victoria 6 days ago

    This is really interesting. I've always wondered why the view count would be stuck for awhile on certain videos.

  • mad cobra
    mad cobra 7 days ago

    3:56 race condition shouldnt happen because programmers force the computer to be single threaded when it comes to reaching the same data at the same time. but i dont know which parts of youtube have forced single threading or not.
    You dont have to put the user on queue to make this. You can let user watch the video and start a new thread that waits to add one to the view count.

  • eɪtʃ mīndər
    eɪtʃ mīndər 7 days ago

    what should that be ? a part of some kind of "truth" ?! we all know that all plattforms arent political independend. all internet platforms are controlled to hide the truth for the success of a small group of oligarchs. all you told might be correct, but at the end of the day it is not possible to have less likes than in the beginning of it !!!

  • Joshua Sweetvale
    Joshua Sweetvale 8 days ago

    That's a DUMB use of multithreading.

  • Twinrehz
    Twinrehz 9 days ago

    Hehey, I have a Texas Ti 99/4A too! In working order, no less.

  • Reza Karami
    Reza Karami 9 days ago


  • Moore Time in the Kitchen

    Yesterday, on my main channel page my subscriber count was showing as 925. In reality it was 66. Still not entirely sure how it ended up that wrong even after watching this very well put together explanation.

  • Raine Riny 7
    Raine Riny 7 11 days ago

    Sometimes I have noticed the number of likes exceed the number of views in TVclip.

  • Jesse Okeya
    Jesse Okeya 12 days ago

    Tom Scott for president!

  • Mnoppee e
    Mnoppee e 12 days ago

    I'm just gonna say it's amazing how this was done without cuts

  • 2Tri
    2Tri 13 days ago +1

    0:00-0:03 What?
    0:04 Then wouldn’t every tweet be brilliant?

  • Coco_EC
    Coco_EC 14 days ago

    Well explained! Thanks!

  • Drew Puffer
    Drew Puffer 14 days ago

    Is this why it takes 10 business days to unsubscribe from spam email?

  • Tularis
    Tularis 15 days ago

    I love it when Tom explains something. I makes it sooo easy to understand! ❤️

  • SuperBlueBomb
    SuperBlueBomb 15 days ago

    Now I have found out why on very new videos by popular channels have more comments than views

  • Matthew Eargle - AirborneSurfer

    Single-thread computing: Bake a cake.
    Eventual consistency: The cake is a lie. Or it isn't. Maybe.

  • WeShall4ttack
    WeShall4ttack 16 days ago

    Is that the logo of National Geographic behind you? :P

  • Brian White
    Brian White 17 days ago

    The absolute nerve of you to make me slightly less ignorant. How DARE you, good sir! /s

  • Matt Douglas
    Matt Douglas 17 days ago

    Thank you for this!
    Because of the whole Diablo mobile TVclip dislike thing that went on this is both very relevant and explains a lot to people who jumped on the angry bandwagon that assumed there were some dodgy dealings going on with TVclip

  • Chris Musix
    Chris Musix 17 days ago

    I've been staring at that initial tweet for a week trying to figure out why exactly it's brilliant.

  • Dazzling Sky
    Dazzling Sky 18 days ago


  • Leonard Wong
    Leonard Wong 18 days ago

    i always unlike if i liked something by mistake

  • Ivan Vučica
    Ivan Vučica 18 days ago

    You're doing the FSM's work here.

  • Yung Kirk
    Yung Kirk 18 days ago

    var VIEWCOUNT = 0;
    if (VIDEO_WATCHED == true){

  • Ba A
    Ba A 19 days ago


  • Marco Bertoglio
    Marco Bertoglio 19 days ago

    Old guy says... You help me to understand, and that is a great gift. Thank you!

  • d610
    d610 19 days ago


  • Joseph Louwerse
    Joseph Louwerse 19 days ago

    So this is why t-series got 9000 subs in one second

  • Social Blade
    Social Blade 20 days ago

    Great video! We get people asking about this topic all the time!

  • nikoli gogle
    nikoli gogle 20 days ago

    People used to do these manually in past days. WOW! 😱

  • Adam Ricks
    Adam Ricks 20 days ago

    Is this guy 18 or 45?

  • ganymede Jupiter
    ganymede Jupiter 20 days ago

    Nice timing ,I was just reading os processes and scheduling..

  • ganymede Jupiter
    ganymede Jupiter 20 days ago

    Great vid

  • Mark Penrice
    Mark Penrice 20 days ago

    Threading weirds arithmetic?
    Also I wonder if this explains the difficulty EDF had with sending me a correct bill, even though it only took me a couple of minutes to work out the correct amount by hand (and an hour to call them up, wait on hold, then get them to remedy the incorrect figures) each time...

  • Ryan Morris
    Ryan Morris 20 days ago

    I just want to complement you, Tom, on your narration. I've noticed the One-take approach before on your videos, but this one was impressive. It can't be easy to keep your inflection and pacing interesting for such a long take, let alone doing it in such a conversational tone.

  • kmccravy
    kmccravy 20 days ago

    Thanks for coming to ThinkerCon!

  • Walter Burton
    Walter Burton 21 day ago

    I ❤ TI-99/4A

  • Dan Dart
    Dan Dart 21 day ago


  • Dan Dart
    Dan Dart 21 day ago

    I created the infrastructure from the ground up on two high traffic, big data systems, and this is similar to how I used to do things, however I just stuck to the caches, and had a couple of replicated queues that hit one replicated database at some point. In this case, it was the database doing the queueing up of the big bundles, and the read-only database clones that were being asked for bundles of data to be calculated. Still an amazing subject to cover, and you make it really simple to understand!

  • Emmo Hernández
    Emmo Hernández 21 day ago

    This reminded me of so many things I learnt on my Operating Systems lectures so long ago.

  • Davri
    Davri 21 day ago

    I wish everyone saying "lmao 15 likes 0 views youtube is high 😂😂😂" saw this video

  • FlyTech Videos
    FlyTech Videos 21 day ago

    Knock knock, race condition, who's there?

  • theSPUDereHD
    theSPUDereHD 21 day ago

    You said "math" ... not "maths" ... I'm disappointed

  • Bálint Gabulya
    Bálint Gabulya 22 days ago

    A question regarding the last part. Why would it need to be asynchronous requests? Why not just update the caches with a pub-sub system every now and then? Caches could then update the information themselves from a queue.

  • Lee Fraser
    Lee Fraser 22 days ago

    I LOVE IT :)

  • ethologic
    ethologic 22 days ago

    I’ve never seen a game of Frogger go for so long...

  • GreenMan
    GreenMan 22 days ago

    Math?! Come on Tom you know it's Maths....

  • Interpolation 255
    Interpolation 255 22 days ago

    Why is frogger being played on the third computer down?

  • timtranslates
    timtranslates 22 days ago

    I noticed one of my favourite games, Frogger, in the background. The screen with the tree looks familiar, but I can't remember what the game is.

  • Jellyfish Swag
    Jellyfish Swag 22 days ago +1

    This is why TVclip Screwing up the view counter!!!

  • Omari R
    Omari R 23 days ago

    It's DNS

  • Andrew Micallef
    Andrew Micallef 23 days ago

    I had an idea that it was something to do with cache somewhere, but I thoroughly enjoyed the explanation and detail without going overboard. Thanks Tom!

  • Arthur Khazbs
    Arthur Khazbs 23 days ago

    But instead of reading, incrementing and writing, can we not just send the 'increment this' command to the database?

  • Richard Pike
    Richard Pike 23 days ago

    I wonder how hard it was to get all those computers running in the background

  • Jeremy Holovacs
    Jeremy Holovacs 24 days ago

    Ah, the TI-99/4A... I learned to program on that machine...

  • Vineyarddawg
    Vineyarddawg 24 days ago

    The single threaded cake is a lie!

  • Pyro Is A Nazi
    Pyro Is A Nazi 24 days ago +1

    Sometimes they just can’t be arsed.

  • /\non/^\edi€
    /\non/^\edi€ 24 days ago

    Wonderfully explained.

  • thefatmoop
    thefatmoop 24 days ago

    Why computers can't count, then you give an example of an implementation issue... Ok

  • Musical Armageddon
    Musical Armageddon 24 days ago

    disappointed, tom

  • Dom
    Dom 24 days ago

    Fart at 4:48

  • Rob Fraser
    Rob Fraser 24 days ago

    Eventual Consistency is something most of us will do at work if our job has multiple tasks, like for instance if your job is to take orders and then put those orders into another system you will likely cache several orders over a busy period and then input them when your shift dies down later on. Eventual Consistency. "Is the system up to date, Rob?" - "It was as of two hours ago but as you can clearly see I'm the only person answering the damn phone!!"

  • dwarfie24
    dwarfie24 24 days ago

    Note: This video includes Words like race conditions.

  • Epic Troll Internet
    Epic Troll Internet 24 days ago

    This is why once i saw a video here on TVclip with 2 view and 8 like

  • My replies dont matter, but i would like to say

    You never disappoint, Scott!

  • fede
    fede 24 days ago

    Nice video!! But I find the title somewhat misleading. It's not that computers can't count. It's not a hardware related subject, it's a software implementation matter. But hey, maybe I'm too picky.

  • Amin Heidare
    Amin Heidare 24 days ago

    Your channel is great , I do enjoy watching your videos. Thank you

  • Mc Egavas
    Mc Egavas 24 days ago +1

    Math(!), really?

  • peddersmeister
    peddersmeister 24 days ago

    Really interesting vid :)

  • Gabriel Weinberg
    Gabriel Weinberg 24 days ago

    Makes sense! What about solving this server-side by having the same cache server assigned to requests coming from the same IP address ? Or client-side with some JavaScript that will only display the highest of the numbers, not allowing it to fluctuate ? Just wondering.

  • Revoosh Noj
    Revoosh Noj 24 days ago

    67 68 69

  • Master Marf
    Master Marf 24 days ago

    It doesn't seem like the same approach would work for the markets. Time and accuracy are so important. Bots trading with bots where every millisecond of latency matters, you can't have a que or eventual consistency.

  • TheAceOfMagic
    TheAceOfMagic 24 days ago

    nice! whats up with the audio?

  • Carlo Angel
    Carlo Angel 24 days ago

    I guess it has to do with guessing?

  • TheBzlai
    TheBzlai 24 days ago

    Just in time to explain the drama behind the "T-Series Sub Bots"

  • I’m already Sans Undertale

    where's 69?

  • NeutronicalGaming
    NeutronicalGaming 24 days ago

    It's working as intended.

  • Jake
    Jake 24 days ago

    The data visualization animations were quite nice in this video

  • justa9uy
    justa9uy 24 days ago

    The queue doesn't have to make a viewer wait to watch a video, it should only buffer addition to the view count

  • B98k Finnegan
    B98k Finnegan 24 days ago

    Or you're blizzard and you just asked if people have phones

  • thbh88
    thbh88 25 days ago

    Was looking for a 69 in the thumbnail... xD

  • init3
    init3 25 days ago +1

    Fantastic, very interesting Sir!

  • MegaProjectpat
    MegaProjectpat 25 days ago

    Well I could have told you "race conditions" are awful...

  • Einsmic Capito
    Einsmic Capito 25 days ago

    1,152nd awww yeeeee

  • James Lyndon
    James Lyndon 25 days ago

    My videos view numbers always lag out. In fact most of them are still only showing 20 views... it’s been years now...

  • Dukez Venom
    Dukez Venom 25 days ago

    I already know most of this but it was a good listen either way

  • Ricky Gorzel
    Ricky Gorzel 25 days ago

    Tom Scott, is that a ti 84 desktop computer on the left? I have one in my basement that needs a little work :)

  • Matthew Purkis
    Matthew Purkis 25 days ago

    Mary Poppins (A new Nanny)
    Mary Poppins: Nanny McPhee Strikes Back
    Mary Poppins: Return of the Chimney Sweep

    Mary Poppins: the Phantom Nanny
    Mary Poppins: the Kite Wars
    Mary Poppins: Revenge of McPhee

    Mary Poppins: the Umbrella Awakens
    Mary Poppins: the Last Chimney Sweep

  • BloodyClash
    BloodyClash 25 days ago

    :) so very good explained. thank you

  • Matthew Purkis
    Matthew Purkis 25 days ago

    "we have to talk about race conditions..." crikey, that got political

  • halcyondaystunes
    halcyondaystunes 25 days ago

    I'm going to refer all the idiots that keep questioning in You Tube comments why the comments and likes don't match to this video. I bet there are even loads in here still questioning it.

  • Tony Yang
    Tony Yang 25 days ago

    Love the improvement in video graphics and illustrations! Was always expecting the dot matrix printer paper to come out.