Re:Goroutines, Nonblocking I/O, and Memory Usage
by haimez on Thursday January 05, 2017 @07:54PM
(#13332975)
Forgive me if I'm wrong, but I believe this is because the select keyword is a language syntax convenience whereas actual I/O needs a full go routine because that's the unit of parallelism.
[ Parent
| on HN ]
Re:Goroutines, Nonblocking I/O, and Memory Usage
by eternalban on Thursday January 05, 2017 @08:13PM
(#13333096)
Unlike C, Go has a runtime component. Select is not merely syntactical sugar:
Re:Goroutines, Nonblocking I/O, and Memory Usage
by pjmlp on Friday January 06, 2017 @03:48AM
(#13334822)
C has a runtime, it is usually called libc and libm on UNIX C compilers, msvcrt.dll on Visual C++, so forth for each C compiler.
Also some would say POSIX is the language runtime that ANSI didn't want to approve.
Re:Goroutines, Nonblocking I/O, and Memory Usage
by eternalban on Friday January 06, 2017 @11:06AM
(#13337360)
I've always considered a "language runtime" to be an active component of a process written in a given language.
Aren't libc etc. passive and effectively just libraries?
Re:Goroutines, Nonblocking I/O, and Memory Usage
by pjmlp on Friday January 06, 2017 @12:30PM
(#13338210)
No, depending on the compiler it is where the call that calls main() and calls global initialization lives, also where support functions for compiler intrisics might live, also the implementation support for data types not directly supported by the architecture, e.g. floating point emulation.
Re:Goroutines, Nonblocking I/O, and Memory Usage
by eternalban on Friday January 06, 2017 @01:53PM
(#13339068)
Interesting, thanks. In the future I'll be sure to use [the term] active runtime (GC, scheduler).
Re:Goroutines, Nonblocking I/O, and Memory Usage
by fnord123 on Monday January 09, 2017 @06:27AM
(#13355561)
Compiled and linked C code can run without libc.