go, so I started looking at fsnotify <http://github.com/howeyc/fsnotify> for
examples.
As I was going through the code, I became confused once I got to theruntime.LockOSThread call in readEvents()<https://github.com/howeyc/fsnotify/blob/master/fsnotify_windows.go#L403>.
According to godoc, LockOSThread "wires the calling goroutine to its
current operating system thread. Until the calling goroutine exits or calls
UnlockOSThread, it will always execute in that thread, and no other
goroutine can." Since each fsnotify watcher spawns a goroutine that calls
the infinitely looping readEvents, I assume there must be at least one
thread per Watcher. (There must also be at least one other thread to
process the other goroutines in fsnotify.) What triggers the creation of
new threads for each of these readEvent goroutines?
Is there any documentation for the current go runtime's threading model? I
searched but had little success.
--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.