:: Re: [DNG] Wirth's law
Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Rainer Weikusat
Fecha:  
A: dng
Asunto: Re: [DNG] Wirth's law
Jaromil <jaromil@???> writes:
> On Sun, 24 Jul 2016, Rainer Weikusat wrote:
>> Didier Kryn <kryn@???> writes:
>> > Le 22/07/2016 18:21, Brian Nash a écrit :
>> >> For example, when I discovered multithreading, all my programs used it
>> >> in some way, even when it was unnecessary.
>> >
>> > I sometimes use multithreading, but never mutexes. Mutex can be
>> > harmless if there's only one. Otherwise better use select()/poll() or
>> > you'll waste time or even dead-lock. It's amazing how the old select()
>> > paradigm is so much better than the modern mutex. I see mutex as an
>> > invention to relieve the programmer from thinking.
>>
>> One of the advantages of having more than one thread of execution
>> running in the same address space is that these can communicate with
>> each other without going through the kernel. And 'a mutex' is just a
>> basic primitive for implementing this.
>
> nowadays the closures paradigm (basically fifo pipes of pointers to
> stateless functions) is used much more than all that mutex and
> semaphore old stuff.
>
> i.e. golang adopted closures since the beginning
> with great success.


I think you meant to write coroutines, not closures, as that's what go
adopted based on Hoare's 'Communicating Sequential Processes'. That's
also pretty 'old stuff'. It's also unfortunately an instace of something
which should really be called such-and-such-a-law,

    As soon as one guy has learnt that people use multi-threading to exploit
        shared-memory multi-processors and not to avoid state machines, on comes
    the next "been living under a rock since 197x" person and re-implements
    cooperative userspace threading again.