--
---
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Just exposing it is simple. But we need a good stable API that is usable for variety of use cases on different OSes.
Do you have a use case?
One of the use cases may be file io on windows.
I am not sure we can make it work for both network/file on Linux.
A safer way to do it is to have third party package that uses c/asm to call private functions in runtime. Then try to use it. Then make it standard.
sent from phone
Get rid of C vararg calls from Go code. Mostly converting arguments and return values from T to *T so the pointerness of their arguments can be described succinctly.
CL 14794043 (go-mapnovararg) for maps
CL 23310043 (go-iconv) for interface conversions
CL TBD (go-assert) for interface assertions
CL TBD (not started) for channels
…stdcall, deferproc, deferreturn, newproc, concatstring
Get all C code off of the G stack. This is in preference to teaching 6c how to emit pointer-map information for its local variables.
CL 23250043 (go-mapong0) is an experiment to measure the performance cost of switching stacks (answer: 3-6 ns/call)
fix stack unwind bug 6619
Treat cast to unsafe.Pointer as escaping (other option - fix reflect.Value and hope no one else is storing nonpointer info in an unsafe.Pointer)
CL 22290044 (go-unsafestack)
Provide funcdata for necessary asm routines (callXX, others?)
part of #6 for now, but I can separate it out
copyable stacks, including panic reimplementation
CL 9029047 (go-movestack) (cgo portions incomplete)
#2 depends on #1. #6 depends on all four.
On Wed, Nov 13, 2013 at 1:46 AM, Dmitry Vyukov <dvy...@google.com> wrote:My use case is reading devices like serial terminals and odd file like
> Just exposing it is simple. But we need a good stable API that is usable for
> variety of use cases on different OSes.
> Do you have a use case?
things in /sys/class/gpio.
This can be done already, but concurrent read and close operations are
undefined, so using a poller type operation is required to get that
behaviour.
On Thu, Nov 14, 2013 at 5:20 AM, Dmitry Vyukov <dvy...@google.com> wrote:Yes, but only on linux, which is ok because the /sys filesystem is
> On Wed, Nov 13, 2013 at 4:40 AM, Dave Cheney <da...@cheney.net> wrote:
>>
>> On Wed, Nov 13, 2013 at 1:46 AM, Dmitry Vyukov <dvy...@google.com> wrote:
>> > Just exposing it is simple. But we need a good stable API that is usable
>> > for
>> > variety of use cases on different OSes.
>> > Do you have a use case?
>>
>> My use case is reading devices like serial terminals and odd file like
>> things in /sys/class/gpio.
>
>
>
> Do these file descriptors work with epoll?
linux only. However, polling on serial terminals would need to work on
kqueue/epoll/select, etc systems.
>> This can be done already, but concurrent read and close operations areThen that pushes me strongly to think this doesn't need to be
>> undefined, so using a poller type operation is required to get that
>> behaviour.
>
>
>
> This functionality is not provided by the poller. The poller requires that
> there are no races between read/close. This functionality is provided by
> fdMutex:
> https://code.google.com/p/go/source/browse/src/pkg/net/fd_mutex.go
integrated into the runtime.
I still do not understand what change you want.
On Thu, Nov 14, 2013 at 1:01 AM, Dmitry Vyukov <dvy...@google.com> wrote:
I still do not understand what change you want.as i understand it, he (actually I) probably want API like this:// PollFd lets the runtime integrated poller take care of waiting on fd becames// ready for PollerMode, and return the readiness from the returned channel.// fd must be a valid pollable fd, otherwise the behavior is undefined.func PollFd(fd uintptr, mode PollerMode) <- chan PollerInfo// UnPollFd unregisters the fd from the poller.func UnPollFd(fd uintptr) // unregisters fd from the poller
On Nov 14, 2013 1:42 AM, "Dmitry Vyukov" <dvy...@google.com> wrote:
>
> On Thu, Nov 14, 2013 at 10:19 AM, minux <minu...@gmail.com> wrote:
>>
>>
>> On Thu, Nov 14, 2013 at 1:01 AM, Dmitry Vyukov <dvy...@google.com> wrote:
>>>
>>> I still do not understand what change you want.
>>
>> as i understand it, he (actually I) probably want API like this:
>>
>> // PollFd lets the runtime integrated poller take care of waiting on fd becames
>> // ready for PollerMode, and return the readiness from the returned channel.
>> // fd must be a valid pollable fd, otherwise the behavior is undefined.
>> func PollFd(fd uintptr, mode PollerMode) <- chan PollerInfo
>> // UnPollFd unregisters the fd from the poller.
>> func UnPollFd(fd uintptr) // unregisters fd from the poller
> Why don't you want API similar to the current one? I.e.
> WaitRead(fd) // blocks until fd is ready for reading
> WaitWrite(fd) // blocks until fd is ready for writing
> The channels may be slower and less idiomatic for IO.
but we need to figure out a way to wait on several things, e.g.
1. terminal could read something
2. not timed out
3. not interrupted.
i think we can achieve 1 and 2 with the current net poller API, but not sure about 3.
(it could be implemented if the current net poller is exposed, but not very simple. i.e. the behaviour i want can be simulated with the current API with another goroutine)
And I'm not sure whether we can devise a more general (and efficient) API than the current if we want to expose the poller.
On Nov 14, 2013 1:46 AM, "Dmitry Vyukov" <dvy...@google.com> wrote:
>
> and what about fdMutex (concurrent read/close)?
i think for non-network IO concurrent read/close is almost always an error.
Yes, I want that too, but I thought you said that was part of the net package, so I was going to solve that part of the problem with the copy pasta button.
But you do want to close /dev/ttyUSB0 if you're cleaning up after programming an AVR microcontroller (to pick one example)
I will raise an issue.
Along with my Android proposal, I'd be interested in getting darwin/arm aka ios support into mainline. It depends on 4717 (cgo enabled cross compiling) just like my proposed Android port. It also depends on 4069 which I think need very little work to cover darwin/arm (5l already supports external linking on linux/arm).minux is the author of the iOS port, and I'm willing to help out with any work to get it merged.
--
---
You received this message because you are subscribed to a topic in the Google Groups "golang-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-dev/846QFpppXUo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-dev+...@googlegroups.com.
I like everything about this plan.
--
---
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+...@googlegroups.com.