Live data from Hacker News

24-core CPU and I can’t type an email – part two

randomascii.wordpress.com

11–20 of 101 posts

Re: 24-core CPU and I can’t type an email – part two

#11
post #10

I have on my desk a machine that would be an equivalent of a large datacenter two decades ago and then sometimes it is barely able to keep up with me pressing keys on the keyboard. I think the next major step will be for the humanity to learn make software more efficient and effective rather than throw more CPU cycles at the problem.

It will happen naturally. Throwing hardware at the problem is still the most economical thing to do. Features and speed of development still beat performance. When that's no longer true we'll focus on performance again.

Re: 24-core CPU and I can’t type an email – part two

#12
post #10

I have on my desk a machine that would be an equivalent of a large datacenter two decades ago and then sometimes it is barely able to keep up with me pressing keys on the keyboard. I think the next major step will be for the humanity to learn make software more efficient and effective rather than throw more CPU cycles at the problem.

In the last few years we switched from throwing more CPU cycles at the problem to throwing more CPUs at the (not necessarily parallelizable) problem.

Re: 24-core CPU and I can’t type an email – part two

#13
Could you build on the always-unfair system along these lines? (C11ish, sorry)

  void 
  do_work(the_work_t *w)
  {
     /* for simplicity here, rather than e.g. w->contenders */
     static _Atomic int contenders = 0;
     
     contenders++;
     for ( ; work_remaining(w); ) {
       take_mutex(w->m);
       do_some_work(w);
       drop_mutex(w->m);
       if (contenders > 1)
         reschedule_this_thread();
     }
     contenders--;
  }
This depends on the OS providing a cheap and fast reschedule_this_thread() mechanism that effectively guarantees that if there is only one other contending thread with work, that thread will end up holding the mutex. (If there are multiple such threads, an arbitrary one of them will end up with the mutex, rather than the thread that just dropped the mutex.)

One could of course only check for other contenders every few times through the for loop if reschedule_this_thread() is expensive or slow, or if contenders is especially hot.

contenders is explicitly not a locking mechanism and should not influence the policy of any code running while the mutex is held. It should also be a per-mutex counter.

Re: 24-core CPU and I can’t type an email – part two

#14
post #12
post #10

I have on my desk a machine that would be an equivalent of a large datacenter two decades ago and then sometimes it is barely able to keep up with me pressing keys on the keyboard. I think the next major step will be for the humanity to learn make software more efficient and effective rather than throw more CPU cycles at the problem.

In the last few years we switched from throwing more CPU cycles at the problem to throwing more CPUs at the (not necessarily parallelizable) problem.

Each of the 40 cores on my workstation runs at 3.5 GHz. I had a quick look and I found reference to Google using pentium 2 CPUs in their data centres in 1999. According to Wikipedia, they max out at 450MHz. So my workstation is 8 times faster per core, and has 40 more cores. It's hard to justify the differences really.

Re: 24-core CPU and I can’t type an email – part two

#15
post #10

I have on my desk a machine that would be an equivalent of a large datacenter two decades ago and then sometimes it is barely able to keep up with me pressing keys on the keyboard. I think the next major step will be for the humanity to learn make software more efficient and effective rather than throw more CPU cycles at the problem.

What I want is a system where the keyboard is connected by some connection that is a hardware interrupt like the keebs of the old time. Just don't make it interrupt only when booting. That alone will save a few dozen ms of delay. Then that letter goes straight into a framebuffer that displays it on a 100% 2d DE/editor. Just how writing text is supposed to be.

Re: 24-core CPU and I can’t type an email – part two

#16
You should have asked your pointy haired boss. He could have explained the problem in much simpler terms.

Would you expect 24 employees to write ONE email without 4 team leads and one department head?

Obviously NO!!

Your processors obviously need more management. I think Intel has the right offering for you, aka management engine.

Re: 24-core CPU and I can’t type an email – part two

#17
post #10

I have on my desk a machine that would be an equivalent of a large datacenter two decades ago and then sometimes it is barely able to keep up with me pressing keys on the keyboard. I think the next major step will be for the humanity to learn make software more efficient and effective rather than throw more CPU cycles at the problem.

Instead we get Electron, and people use it to make text editors that take up 500 MB of space.

Re: 24-core CPU and I can’t type an email – part two

#18

You should have asked your pointy haired boss. He could have explained the problem in much simpler terms. Would you expect 24 employees to write ONE email without 4 team leads and one department head? Obviously NO!! Your processors obviously need more management. I think Intel has the right offering for you, aka management engine.

New from Intel: the Scrum processor.

Re: 24-core CPU and I can’t type an email – part two

#19
post #5

> the lock was being acquired and released ~49,000 times and was held for, on average, less than one ms at a time. But for some reason, even though the lock was released 49,000 times the Chrome process was never able to acquire it. Well, locking is hard. > The good news is that even though there is occasional unfairness, there is unlikely to be persistent unfairness. In order for a thread to steal the lock, it needs…

Actually this is exactly because someone in Windows used the plain old mutex. I'd call that "your granddad's lock". It's old, crotchety, unfair and shouldn't be used in situations where any concurrency can be expected. This despite the kernel having a nice RCU mechanism inside as well as waitfree queues.

> I'd call that "your granddad's lock". It's old, crotchety, unfair and shouldn't be used in situations where any concurrency can be expected.

What alternatives do you suggest?

Re: 24-core CPU and I can’t type an email – part two

#20
post #14
post #12

Earlier quoted context omitted.

In the last few years we switched from throwing more CPU cycles at the problem to throwing more CPUs at the (not necessarily parallelizable) problem.

Each of the 40 cores on my workstation runs at 3.5 GHz. I had a quick look and I found reference to Google using pentium 2 CPUs in their data centres in 1999. According to Wikipedia, they max out at 450MHz. So my workstation is 8 times faster per core, and has 40 more cores. It's hard to justify the differences really.

20 years is equivalent to a couple of geological ages in tech, definitely not the "last few years" I was referring to.

This article is from 2014 but hardly anything has changed.

https://www.comsol.com/blogs/havent-cpu-clock-speeds-increas...

https://superuser.com/questions/543702/why-are-newer-generat...

https://i.stack.imgur.com/z94Of.png

Post reply on HN