276 karma · joined July 25, 2017
Though after that I was asked for additional interviews on basic algorithmic stuff cause Google thought original interviews to be too narrow in the scope, anyway hardly any esoteric stuff.
I wonder where all of the battery waste goes and if we are truly better off with piles of lithium batteries but reduced carbon footprint. Did I miss some recycling innovation for said batteries?
5 fingers + two sides of the arm. Cool stuff isn’t it?
A thread is virtual conterpart of the real hardware _thread_ of execution. Without a concept of threads you have nothing in the high-level side to map hardware to. Think again before posting this kind of material, it seems to me vaguely embarrassing.
Now going upper to the place that you probably find the most familar - a user-space. Truth be told if the app is a unikernel there is almost no overhead in switching threads (just switch the stack and update a bunch of registers). So for unikernel they are perfect abstraction, but you may want to add queues, channel etc on top.
Getting to the user/kernel classic OSes - again the problem is lack of trust between user-space and the kernel, the hardware can still switch things quite fast provided we can share most of memory mapping between the two. Nowadays kernel bypass techniques and eBPF running as trusted scripts in the kernel, I do see anything wrong eith threads per see.
The architecture pattern of just spawning one new process or thread per connection is bad only if the said processes or threads are expensive to context switch between, and that cost is a rapidly moving target.
TL;DR: please stop writing and start reading, there is a lot of homework to do here.
https://github.com/glow-stack/vbjt
And it’s basically done and usable. I will likely do ICO soonish.
I too sadly realize the dire need to post such disclaimers. Boy, these people are boring sometimes...
Keep it rolling!
It’s short, simple and to the point. My personal holy trinity. See you around)
s/1/10/
Also similar to but more general than RIO Sockets of Win8+:
https://docs.microsoft.com/en-us/previous-versions/windows/i...
Pick your favorites and change them every now and then.
I prefer hardware constraints such as “it has to run on commodity laptops with OS among the big ones of Windows/Linux/OSX/*BSD”. Or it has to be pure Shell script. Or it has to fit on 3 A4 pages.
Some companies are making billions of dollars, that’s why we see so much content about the cloud and very few about building your own cloud with dedicated providers, which by the way handle electricity, network and basic hardware maintenance for pennies compared to cloud guys. They even have some basic managed services like backups, S3-compatible storage etc. these days.
Library that doesn’t have stable C API is next to useless outside of its original language/community/etc. and I have been bitten by this a few times already myself (my great libraries in D’s std cannot be easily exported outside of D).
Do not repeat my mistakes - provide stable C API (and ABI by extension) as soon as you can. You cannot make it safe though it’s simply not accounted for in the land of linker “technology”.
It all helps but never eliminates the problem completely.
- learning more then a few basic hot keys for zsh (things like ctrl-k, ctrl-r and beyond)
- mastering tiling window manager, today I can switch, compose, mix and match windows in a blink of any eye - it used to take seconds
- switch to minimal OS setup, tile WM, your basic terminal tool suit, browser + the few apps you actually need (saves you trouble configuring all of that extra crap + updating it daily)
- find time to read MAN on every program you use daily, you will find lots of hidden gems in there
1. trying hard to do one thing and do it well (and failing usually), but ...
2. there are many dependencies that you should allow your user to pass explicitly ...
3. and that’s the problem - you have 0% control on how the library is integrated but receive full responsibility for how well does it work. Even libc could be very different and will not behave the way you’d expect it to.
The big problem of making everything a small well thought-out library is large integration surface + having to be flexible and accommodate for all potential cases of integration.
That’s why we mostly have hundreds of overlapping “fat” libraries - too much trouble and too much integration complexity to split them up.