On Jul 15, 2012 10:11 AM, <wojtek...@gmail.com> wrote:
>
> 1) Gorutines are multiplexed automatically onto system threads?
Yes.
> 1.2) Are Gorutines somehow connected to Libtask/Libthread? (I see Libtask have something called channels, so the only difference is support of Windows and multiplexing between os threads?)
No. The goroutines implementation is independent.
> 3) If Go is written in C is it using some libraries for its gorutines and channels or are they implemented in Go's source code?
They are implemented in the Go runtime sources, not in a separate library.
> 3.2) If they are implemented in the source code, would it be possible to use them "in some easy way" in custom C++ application?
No. A key part is intercepting all system calls.
> 4) If Gorutines are further extension of libtask, why Google have not implemented them as separate library for C++?
System call issues.
Ian
On Jul 15, 2012 10:44 AM, <wojtek...@gmail.com> wrote:
>
> Could you please provide further details to point 3.2?
> Maybe can I use this "intercepting all system calls" logic in my custom application together with gorutines and channels? (I understend this could be a little bit stupid question, but I don't know deeply the architecture of go)
The entire Go runtime library is written in Go and a relatively small amount of carefully written C and assembler. Whenever a goroutine makes a system call that may block, the goroutine is removed from the scheduler for the duration of the system call, permitting other goroutines to run.
That would be harder to do in C, short of replacing or extensively intercepting the C system library.
> Where can I find documentation (if such exists) with more precise informations?
src/pkg/{runtime,syscall}
Ian
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
I've heard that it is not recommended to run blocking operations on libdispatch queues. So, apparently, not really lightweight processes there.
I've heard that it is not recommended to run blocking operations on libdispatch queues. So, apparently, not really lightweight processes there.
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.