Monday, June 28, 2010

How to Properly Utilize Modern Computers


Holy abstract concept, Batman! Computers are complicated things, especially modern networked ones filled with multiple CPU cores, and anyone professing to know a singular way to utilize them is truly a madman, or a genius, or a little bit of both... but before we can talk about modern computers we must first talk about computers as they used to be.

While this may look prehistoric, it actually happened at Burning Man

Long ago, programming languages were crap and programming was hard. Ken Thompson and Dennis Richie reinvented the way we think about computers by designing not only a new operating system but a new programming language to write that operating system in. It was an ambitious effort that has forever shaped modern computing. Some people don't appreciate it and wax philosophical about hypothetically superior solutions. Those people are retards. Unix rules. Get over it.

No, this isn't quite as good as having sex


Unix had a brilliant underlying philosophy: do one thing and do it well; use multiple processes to solve problems; use text streams as your interface.  The simplicity of the Unix model had a beautiful elegance to it and made it very easy to leverage host resources in a scalable manner.  Instead of writing big clunky monolithic applications, write several small programs that use text streams to talk to each other.  Then if your host just happens to have multiple processors, the kernel can handle the task of farming out multiple jobs to multiple CPUs.

Shells and scripting languages were created to provide the interface and glue to the underlying system utilities. Users could easily queue up a series of tools to analyze and digest text streams as they saw fit.  The interesting thing about this approach is that often times users of these sorts of utilities were performing pure functional programming.  Each utility acts as a function which accepts its input over a pipe and produces output which it sends over a pipe.
A pearl, not to be confused with Perl.  Perl is not a gem.

Perl fit into this ecosystem beautifully.  Perl was focused at making short scripts which work on text streams, while providing easy conversion back and forth between text streams and numbers, since often times the text stream processing you want to do in Unix involves some kind of math.  Perl is an extremely expressive language which allowed people to write far more powerful scripts than anything that had been seen in previous Unix scripting languages.  It was powerful, expressive, and whimsical.  Unfortunately, its whimsy would also be its demise.

Perl's approach didn't scale well to large applications.  The level of abstraction it provided was targeted at writing short scripts within the multiprocess Unix environment.  However, the tide was turning against the entire Unix philosophy.  Monolithic applications and application environments were soon to become the norm.
OHAI!!!


Java tried to abstract away the underlying operating system.  It was not easy to write Java programs that fit into the traditional Unix philosophy.  Java strongly prefers you talk directly to things in Java Land, and because of that they reinvented standard Unix tools like cron as Quartz. Rather that using the traditional Unix shared-nothing process model to leverage multiple CPUs, Java wants you to use threads.  If you write your entire application this way, you can deploy an application by running a single instance of the Java Virtual Machine and giving it all your system memory.  With a single instance of the JVM you can theoretically utilize all of your available system resources.

Java still got a lot of things wrong.  Threads are one problem (I'll get into that later).  Another is handling application upgrades.  Some environments tried to support hot code swapping, but this usually ended up leaking memory.  In general, the recommended approach for upgrading a Java application is going to be starting and stopping the JVM.  If you happen to be running a network server, such as, say, a web server, this means you have to wait for all clients to disconnect, or you have to shut down without completing their requests.  Depending on the nature of your network protocol, clients may continue to remain connected indefinitely, so upgrades for those types of services typically means mandatory outages.

EWWWWW!!!!

Unfortunately, both the Unix model and the multithreaded model have warts.

Unix doesn't exactly provide the greatest set of tools for managing multiple processes.  The interprocess signaling model used to manage processes left an awful lot to be desired.  The pipe mechanism used for interprocess communication is rather primitive.  Requiring everything be serialized to text streams incurs a lot of overhead, especially when you write several programs in the same language and can use more efficient data structures than text to communicate data.

In that regard, there are a lot of incentives towards moving to something like Java for concurrent programming.  However, threads have warts too.

The semantics are just plain confusing and the possibility error is huge.  There are a set of best practices which mostly come down to the overriding concern: don't share state between threads.  As long as you never share state between threads there is never any concern over data corruption in concurrent programs.  However, many multithreaded programs share state all over the place, using a collection of highly error-prone synchronization mechanisms to try to keep everything kosher.  However, if you happen to forget to synchronize access to any given piece of shared state, you're screwed, you've just encountered a threading bug.  Sharing state between threads requires extreme vigilance on the part of the programmer, and also intimate knowledge about how threads work and their possible caveats.

Beyond all this, threads are managed by the kernel, and talking to the kernel has high overhead.  A truly amazing feat would be to soup up the Unix model and build your system using lots of shared-nothing processes that communicate using messages and mailboxes rather than primitive text streams.  This is exactly the approach that was taken by Erlang.

I AM ERLANG!!!

Erlang took the whole Unix philosophy to the next level.  Erlang process work like Unix processes, except they use mailboxes and messages instead of pipes.  Unlike threads, Erlang processes run in userspace, which makes them relatively fast.  You can create new Erlang processes a lot faster than you can create threads.  The Erlang VM can run one kernel thread per CPU on your system and load balance processes.  Code can be hot-swapped at runtime in a well-defined manner with extremely consistent semantics.  The entire language philosophy emphasizes the creation of distributed, fault-tolerant, self-healing programs which are able to not only leverage an entire computer, but leverage an entire network of connected computers, using a philosophy which is similar to but an improvement on the Unix approach.

In Erlang, all state is immutable.  This completely eliminates the problems of sharing state between threads.  Due to the way the language is designed it is simply not possible.  This opens up possibilities for Erlang language implementers to safely share state across threads, since the data can't be mutated.  Unfortunately attempts at using this approach in the present Erlang virtual machine have not yet lead to significant performance benefits.

Erlang has its own warts.  For everything it gets right semantically, it is still an aesthetically ugly language.  Very few would describe Erlang code as beautiful.  Despite claims that the semantics, and not the syntax are the barrier to learning Erlang, the main excuse I've heard from people who have avoided Erlang is that they don't like the syntax.
Clojure's logo is so awesome!

Clojure offers a different approach to leveraging modern multiprocessor computers.  It provides shared state that threads can work on transactionally, an approach called Software Transactional Memory (STM), which works kind of like a database.  When you aren't inside a transaction, all state is immutable, which means all state within the language is inherently "thread safe".

Because it's built for the JVM, Clojure is able to take advantage of all the previous effort put into an efficient native threads implementation for the Java programming language.  While this is great for utilizing multicore systems, it's still centered around the notion of shared state.  Distributing your program to multiple computers requires a conceptually different approach than you would ordinarily use to distribute a problem to multiple CPUs.

Beyond that, Clojure uses Lisp syntax.  While some people enjoy writing raw syntax trees because its "homoiconic" nature (not to be confused with Madonna or house music) means they can work all sorts of wonderful wizardry with macros, history has shown that in general most people are not really big fans of that sort of syntax.  Lisp has a lot of parens for a reason: because in most other languages those parens are implicit.


So what's the answer?  How do we "properly" utilize modern computers?  I don't have the answer, only an opinion.

The Unix model was great.  It just lacked a few features to really carry it over to distributed systems.  That said, I really like the idea of running a single VM like the JVM per host, and letting it consume all available system resources running a single application.

Erlang lets you do this, except it provides a Unix-like process model with many of the warts excised.  Erlang has excellent process management, and lets you interact with processes on remote nodes the same way you'd interact with the local system.  Erlang replaced the lousy pipe-based model of interprocess communication with messages, mailboxes, and even filters that allow you to selectively receive from your mailbox.

Erlang provides lightweight, shared-nothing userspace processes and a great way for them to communicate, as well as a scheduler that can dynamically load balance them between native threads and thus host CPUs.  Among many programming experts I've talked to there's a general consensus that having some sort of userspace concurrency context, be it a coroutine or a userspace thread, is a very handy construct to have.  Erlang, perhaps more than any other language out there, has wrapped up userspace concurrency contexts into a very neat little package.

I still feel Erlang's main drawback is its syntax, and I have a few ideas about that.  I think my language Reia brings with it the expressivity of a scripting language like Perl or Ruby combined with the awesome semantics of Erlang which allow it to easily utilize networks of multicore computers.  Reia can support the monolithic one-process-per-application approach so associated with Java while allowing developers to write multiprocess applications internally.  Reia is scripting evolved.

34 comments:

phil pirj said...

Thanks for the post!

Java definitely messed up the whole great JVM idea with its ugly inexpressive C-like syntax, shared-state threads and missing basic features that, for example, C# has for years already.
I haven't tried Scala and not going to do so after one of your previous posts, but it's so pity that there's still no perfect languages on the JVM stage.
I'm not sure if I ever mentionned Kilim, it had the potential to move Erlang aside: http://www.ibm.com/developerworks/java/library/j-javadev2-7.html?ca=drs-

It would be really nice to see something like Scala with message passing at 3x Erlang speed.

I really like Erlang syntax, three days of headache and you are looking at other language syntaxes as they are really missing something (FP, MP, PM).

And after years of Java i'm starting to hate OOP (at least the way it is used in some major projects I have to work with). Erlang is way more flexible.

I hope this year will be productive and will bring more interesting players that will finally capture the flag and will replace mammoths. And I'm pretty sure Reia can be in the lead here.

Michael Draper said...


Do any of the modern languages, by default, offload jobs to unused GPU cycles? Mutlicore video cards are a thing now, and unless you're running a game that is using them, it would be nice if the VMs would use all the resources they have available to them.

judess said...

Gotta love people that say computers are complicated, yes its true they are complex but complicated no u can put a computer together from scratch easier then building a model car but we have to look at the past to understand why computers are seemingly becoming less and less compatible with each-other, i ask you to remember Motorized Cars back in the 1960s-1980s if you were even remotely around an engine for one of those Age cars you understand how much easier it was to service those cars yourself and how any part from basically any vehicle could be used for any vehicle parts were almost 100% universal back then there wasn't any "special" piece you needed or the entire system would break down it was general knowledge how to service an engine and that's what the problem was they weren't making any money from servicing your vehicle so they have to make things different and more complex and System Specific so that things aren't Universal and general knowledge and this exact same logic can be applied to the "Advancement of Personal Computers" man what are they up to now windows 11? and im still happy using Windows XP without issues on a 10 year old Frankenstein PC Build using like 20 different systems to strap together i even built my own 2 Fan Wind tunnel to keep it Cold it runs like a beast but you would have to keep this thing at 100% Usage for like 3 months straight to increase the temperature

shina said...

Surveillancekart | CCTV System
cctv installation services
best home security camera system
cctv camera for home
Pestveda | Pest Control
Termite control

Unknown said...


You're so cool! I do not think I've read through a single thing like this before. So nice to find somebody with some original thoughts on this subject matter. Really.. thank you for starting this up. This website is something that is required on the web, someone with some originality! netflix account

ngocnhung said...

Thanks for sharing, nice post! Post really provice useful information!

Giaonhan247 chuyên dịch vụ mua nước hoa pháp chính hãng cũng như giải đáp mua nước hoa pháp xịn ở đâu và chia sẻ kinh nghiệm mua hàng trên amazon hay giải đáp mua hàng trên amazon có đảm bảo không cũng như hướng dẫn mua hàng trên ebay việt nam uy tín, giá rẻ.

anosh said...

تركيب اثاث ايكيا بالرياض
عامل تركيب اثاث ايكيا بالرياض
فني تركيب ستائر بالرياض
عامل تركيب ستائر بالرياض
محلات تركيب باركيه رخيصة بالرياض
شركة تركيب خشب باركية بالرياض
معلم تركيب غرف نوم بالرياض
تركيب غرفة نوم بالرياض
تركيب غرف ايكيا بالرياض
شركة تركيب عفش بالرياض
شركة تركيب اثاث بالرياض
انتشرت في الآونة الأخيرة الكثير من المدعين في مجال الخدمات وبخاصة تركيب الأثاث ويتضح في نهاية الأمر أنهم مجموعة من الهواة ويظهر ذلك في طريقة عملهم الغير محترفة وما يسببوه من أضرار بالغة علي الأثاث لذا تنصح شركة تركيب اثاث ايكيا بالرياض بالحرص في اختيار الشركات فتعتبر شركة تركيب اثاث ايكيا بالرياض من الشركات الرائدة في مجال الأثاث فهم يتعاملون مع كافة أنواع الأثاث وبخاصة الأثاث الأيكيا بشكل احترافي وبكفاءة عالية
وتتعامل الشركة مع طاقم عمل مدرب علي أعلي مستوي وخبير في تركيب كافة أنواع الأثاث عامة وأثاث أيكيا بصفه خاصة كما يخضع طاقم العمل للكثير من الدورات التدريبية الدورية التي تقوم بها الشركة لتحسين أدائه وتطويره
كما تستخدم الشركة أحدث الأجهزة والمعدات الخاصة بتركيب أثاث ايكيا وبأعلى التقنيات كما تقدم الشركة أسعار لا تقبل المنافسة لذا فهي تناسب جميع الفئات والطبقات وقامت شركة تركيب اثاث الأيكيا بالرياض بتفعيلة خاصية خدمة العملاء للرد علي كافة استفسارات عملائها الكرام
فني تركيب ايكيا بالرياض
لن يكون من الصواب التعامل مع أي عامل أو فني من مكان غير معلوم أو يتبع شركات الهواه فلن يكون محترف ويسبب الكثير من الأضرار والمشاكل خاصة عند التعامل مع أشياء هامة كتركيب الأثاث خاصة أثاث ايكيا فعدم الحرص في التعامل معها قد يسبب خدشها أو تشويه منظر الأثاث الجمالي لذا تحرص الشركة تركيب ايكيا بالرياض في التعامل مع فريق عمل كامل ومدرب ويتضمن فنيون في تركيب ايكيا في الرياض فخبرتهم تمكنهم من القيام بالعمل بشكل احترافي كما أنهم يستخدمون أحدث التقنيات والأدوات والمعدات اللازمة لتركيب ايكيا فهم يتعاملون معه برويه وحرص، وتقدم الشركة أسعار مميزة تناسب جميع الفئات والطبقات

loopo said...

hotmail.co.uk gdsg

Pervez Joarder said...

It blogs post is known as an agreeable and invaluable merely one, at present My group is tremendously obsessed with it brought to you subject. Let’s expectation more fabulous content pieces is possibly used with each of your internet page. At that point push these kitchen remodeling weschester county Appreciate it much in addition to and accommodate issuing.

ahmed said...

It works on spraying sewage pipes and pipes.

• The company sprinkles the house's own skylights, as these are popular placesافضل شركة مكافحة حشرات
شركة مكافحة النمل الابيض بالرياض
شركة مكافحة حشرات بالرياض
شركة رش مبيدات بالرياض

oasisproperties17 said...

Over the most recent a half year time period we are finished AutoCAD training for more than 80+ understudies with incredible input and arrangements. We are charging extremely aggressive in the market which brings more AutoCAD experts into this market. Our AutoCAD training course charge is extremely ostensible which anybody can pay in portion premise also. We are having various class timings which suit everybody who needs to learn in their very own timings.
For More Info:- AutoCAD course in Gurgaon

dadyar said...

آیا واقعا می توان اقدام به گرفتن مهریه بعد از طلاق کرد. این سوالی است که وقتی خیلی ها می شنوند شکه می شوند چرا که تا به حال درباره حقوق خود چیزی نمی دانستند. شاید برای شما هم پیش آمده باشد که در دوستان و یا آشنایان، کسانی که برای طلاق خلع و یا طلاق توافقی مهریه خود را بخشیده باشند و پشیمان شده باشند اما هیچکدام جواب این سوال را ندانند و فرصت احقاق حق را از دست داده باشند.
در پاسخ به این سوال باید بگوییم که، بله زن می تواند اقدام به گرفتن مهریه بعد از طلاق کرد. مهریه تحت هر شرایطی به زن تعلق می گیرد. حتی بعد از طلاق، البته در این مورد که مهریه یک بار برای طلاق بخشیده شده است و بعد به آن مراجعه می شود کمی شرایط را متفاوت می کند که به آن خواهیم پرداخت.
در چه مواقعی زن نمیتواند اقدام به گرفتن مهریه بعد از طلاق کند
اگر زن و مرد به صورت لسانی (زبانی) توافق کرده باشند که در ازای بخشش مهریه از هم جدا شوند، طلاق از هر نوعی هم که باشد زن می تواند پس از طلاق به آن رجوع کند. اما اگر زوجین به شکل قانونی عمل کنند، یعنی بعد از این که توافق صورت گرفت، زن با برگه دادگاه و ثبت بخشش مهریه و تحویل سند آن به مرد، موجبات طلاق را فراهم بیاورد. در این صورت زن دیگر نمی تواند بعد از طلاق به مهریه خود رجوع کند.
در چه مواقعی زن نمیتواند اقدام به گرفتن مهریه بعد از طلاق کند
در چه مواقعی زن نمیتواند اقدام به گرفتن مهریه بعد از طلاق کند
شرایط گرفتن مهریه بعد از طلاق
در طلاق مرد موظف است اگر مهریه را تا آن زمان پرداخت نکرده است، در هنگام طلاق به تصمیم طرفین و یا دادگاه، بعد از طلاق پرداخت شود. اگر مهریه برای طلاق از سوی زن بخشیده شده باشد زن می تواند در مدت عده به آن رجوع کند و دادخواستی برای گرفتن مهریه بعد از طلاق به دادگاه ارائه کند.
اگر از مدت عده بگذرد دیگر نمی توان برای گرفتن مهریه دادخواستی تنظیم کرد. در طلاق خلع که زن چیزی بیش از مهریه (فدیه) را می بخشد تا طلاق بگیرد، پس از طلاق تنها می توان مهریه خود را طلب کند و امکان گرفتن فدیه وجود ندارد.
برای گرفتن مهریه بعد از طلاق در دوران عقد یعنی زمانی که زن باکره است و مقاربتی با همسرش نداشته، زن تنها مالک نصف مهریه است و زوجه تنها می تواند نیمی از آن را طلب کند. البته اگر قصد طلاق نداشته باشند زوجه می تواند تمام مهریه خود را طلب کند و اگر پس از گرفتن مهریه اقدام به طلاق کنند زن موظف است نیمی از مهریه گرفته را به زوج بازگرداند. از توضیحات داده شده این موضوع بر می آید که اگر زوجه بخواهد پس از طلاق دادخواست باز پس گیری مهریه در طلاق در دوران عقد( و یا طلاق توافقی در دوران عقد) بدهد، فقط می تواند نیمی از مهریه را بگیرد. امیدواریم اگر مشکلاتی برای زندگی مشترکتان ایجاد شده هر چه زودتر حل شود.

geekymr said...

if you are searching clan name for your team then read this esports team name ideas
spotiyr premium apk mod you can use this spotify version to get sportiy service in free and for netflix free service use thisnetflix mod apk download

sara said...

مظلات وسواتر
افكار
مظلات
تركيب مظلات
سواتر
مظلات ساكو
قرميد
بيوت شعر
مظلات خشبية
خيام بيوت شعر
كلادينج
شبوك
مظلات لكسان

customized gifts for him said...

burlap ring bearer pillow
waterproof outdoor pillow case
baby decorative pillow

anjli said...



Also known to come with crucial offerings for its sensible, down-to-earth and important clients,Escorts Service in Gurgaon really means in fulfilling their lives with cheerful moments to make love in concern to ensure them live their lives in abetter way. Check our other Services...
Escorts Service in Gurgaon
Escorts Service in Gurgaon
Escorts Service in Gurgaon
Escorts Service in Gurgaon
Escorts Service in Gurgaon


Unknown said...

sad shayari. Minh biet roi ban a! Ma noi nhu vay nghia la sao?

augustwalker said...

123.hp.com/setup printer are extremely favored by individuals for both home and business purposes.In general,these printers and scanners accessible in the market, best case scenario costs range.Most individuals lean toward HP printers for getting best printer solution.Now it very well may be used for intermittent family unit use to standard every day printer in the office.if you need all data visit: 123.hp.com.

nanna888 said...

Easy bets, best prices with free credits here. Easy withdrawals, fast, safe. m928bet Let's go in

aditya said...


Thanks for sharing this post.It is very informative and helpful.


xpause
wire club
romsmaniab

Darren Demers said...

Because it's built for the JVM, Clojure is able to take advantage of all the previous effort put into an efficient native threads implementation for the Java programming language. While this is great for utilizing multicore systems, it's still centered around the notion of shared state. Distributing your program to multiple computers requires a conceptually different approach than you would ordinarily use to distribute a problem to multiple CPUs. bedsheets buy online , premium bed sheets , queen size fitted bed sheets , bridal bed covers , cotton duvet sets , vicky razai factory address , sofa cover sofa cover , velvet duvet cover , cotton razai cover , bath towels set

Escorts Service Kolkata said...

kolkata escorts |
kolkata escort |
kolkata escort service |
escort service in kolkata |
kolkata escorts service |

R1se Hluoluo said...

Berbagai Jenis-jenis Permainan Kartu Yang Betul-betul Seru Demi Dimainkan. Istilah kartu tidak akan telah terdengar baru. Jangankan jenis berjudi tersebut sudah berada dari dahulu banget. Segala kalangan boleh memainkannya disebabkan termasuk berjudi yg gampang. Berbagai orang juga makin melihat permainan itu meruoakan permainan rakyat.

Berawal sejak suatu hiburan, siapa sangka jika dengan berjudi kartu bandar ceme 9gaming Kalian bisa mendapatkan keuntungan tambahan. https://partypokerpokergame.com Salah satunya adalah ketika bermain kartu menggunakan taruhan. Pasti sesuatu itu akan menambah keseruan dalam memasang taruhan sehingga menaikan motivasi demi tetap menang.

Tentu segala paham jika main judi dengan kartu untuk sarananya bukan suatu sesuatu baru. Seiring secara berkembangnya jenis memasang taruhan kartu, sehingga arti judi pun kian berkembang. Beberapa orang bukan baru sekedar menarik hiburan. Kendati terdapat yg sebetulnya minat fokus untuk mendapatkan taruhan sejak memasang taruhan judi.

SAVIOLA said...

This information is very helpful .Thank you for sharing with us. This blog is educative and informative in helping us to build our carrier, keep up the good work. LASU post utme past question

Qasim Khan said...

The very next time I read a blog, I hope that it won’t fail me as much as this particular one. I mean, Yes, it was my choice to read through, however I genuinely believed you would have Help With Do My Homework Service England for me something helpful to say. All I hear is a bunch of complaining about something that you could fix if you weren’t too busy searching for attention.

George said...

We're here to help you grow your business. The second most effective and result-oriented seo content strategy
strategy for lead creation is content writing.

Aaasdsd said...

Watch the latest updates of seriale turcesti subtitrat in Romana on IUBIREA INVINGE Clicksud. You can watch the latest upates the latest updates of seriale turcesti subtitrat in Romana bockmark us.

izspa said...

nice blog Visit body to body massage in Elecrtonic City

james said...

I am agree this statement "You don't need flying cars. But you'll need a different kind of software". Now its time to avail power only dispatch servicesfor more details.

Toasty Toad stool said...

Shells and scripting languages were created to provide the interface and glue to the underlying system utilities. roblox tutorials get-mobdrovip.com

John Hardy said...

A lot of good and great information in this article. This modern computer is really useful today. Everyone really like it. Thanks for sharing this article. Now it's time to avail Locksmith Leeds for more information.

trevor said...

I am enlightened reading your article and I agree with you we should learn t utilize these modern computers for productivity not just use them to do my online exam web 2.0 and 3.0 are most helpful if you use them effectively

Wilson said...

I am so glad to read this blog, thanks for your informative blog sharing with us. I am so amazed to read this and I learned more about this...Thanks for put more efforts to share this wonderful informative content.
¿Cuánto tiempo toma un divorcio de mutuo acuerdo en Nueva Jersey?
protective order virginia beach

Payday Cash said...

Say yes to your dream home improvements with santander debt consolidation personalized loans, making your home enhancement goals a tangible and achievable reality.