Ir para o conteúdo
ou

Software livre Brasil

 Voltar a Blog
Tela cheia

Real Life: Programming is about logic and simplicity

13 de Janeiro de 2010, 0:00 , por Software Livre Brasil - 0sem comentários ainda | Ninguém está seguindo este artigo ainda.
Visualizado 379 vezes

Why is it so hard for non-programmers to understand mutex locks?

No… I am not asking non-programmers to understand programming at all. But concepts that we use in programming that came from real-life in the first place? Come on… Programmers learned from real-life, not the other way around!

Let me explain: at the hospital, after a not so clever renovation, we ended up with an employee restroom that is far from work place (in fact, almost in another department). Most of the times it is occupied… So it takes a trip to the restroom just to learn that it cannot be used at that moment! In a busy morning, one of those trips is just what one can do!

As a programmer I suggested a mutex lock: change the restroom door lock and make only one copy of the key, that should be kept in a common place and returned after being used. If you want to use the restroom and it’s occupied, just learning the key is not there is enough to save a useless trip.

Come on… that is not a hard concept! As I said, we, programmers, learned it from real-life, in settings just as the one I described above!

Well, I just got the key (“acquired the lock”, in programmer speech) and went to the restroom. When I unlocked the door I was surprised by someone already using it! How embarassing! Someone had the smart idea of making a copy of the key! What part of the mutex concept did people not understand?

Luckily, most computational mutex algorithms prevent “lock cloning”... :-)


Fonte: http://www.nardol.org/2010/1/13/real-life-programming-is-about-logic-and-simplicity

0sem comentários ainda

Enviar um comentário

Os campos são obrigatórios.

Se você é um usuário registrado, pode se identificar e ser reconhecido automaticamente.