On Tue, 29 Mar 2016 10:39:01 -0500 Sam Whited wrote:
On Tue, Mar 29, 2016 at 8:41 AM, Konstantin Khomoutov
According to manual pages on my Linux system, 4 syscalls and
accompanying data types cover the whole semaphores thing.
So, this task appears to be tractable.
If you're using existing semaphores created by another process this is
true, but if you want to create your own semaphore you'll need to be
able to call sem_open(3) (for named semaphores; there are other
methods for closing, unlinking, creating unnamed semaphores, etc.).
I assume this is what he's asking about, and it would probably make
sense to stick something like that in x/sys/unix.
A full list (I think?) would include:
No, the 3rd section of manual pages on Linux-based systems means
facilities provided by libraries -- either libc or other user-space
stuff. This means cgo. Go-specific code should strive to rely on
system calls only; and for x/sys/unix it is, I assume, a must except
we're talking about some "weird" platforms like Solaris (?) which must
route all calls to the kernel through libc. On Linux-based systems,
syscalls are described by the pages in the 2nd section, so here we go:
~% apropos semaphore | grep -F '(2)'
semctl (2) - System V semaphore control operations
semget (2) - get a System V semaphore set identifier
semop (2) - System V semaphore operations
semtimedop (2) - System V semaphore operations
Quick googling reveals that indeed this appears to be a rather complete
set of stuff to deal with semaphores.
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 firstname.lastname@example.org.
For more options, visit https://groups.google.com/d/optout.