On Mon, Jul 04, 2022 at 01:57:06AM -0700, Chenhong Liu wrote:
[...]
> After profiling the process with perf command, the perf data shows the
> program looped to call __vdso_clock_gettime .
>
> 64.20% controllerd [vdso] [.] __vdso_clock_gettime
> 8.82% controllerd controllerd [.] runtime.procyie
Hi,
I have a tree datastructure where mutating some nodes *may *trigger a
mutation on some other tree nodes.
This tree should be accessible by multiple goroutines but mutated by only
one at a time.
As such, I wanted to have a global lock on the tree such that mutatiing
node methods should acq
Have a public Set() that does the lock and then calls a private internal
function, which assumes it's already running under the lock.
https://go.dev/play/p/M1XuC8bxCxL
On Tuesday, 5 July 2022 at 13:32:26 UTC+1 atd...@gmail.com wrote:
> Hi,
>
> I have a tree datastructure where mutating some node
>
>
> For me, this looks like the program is merely idling, and what you're
> observing is reading current time by the scheduler implemented by the Go
> runtime.
>
I didn't try it. The environment located in customer's data center, not
allowed to try this kind of things on it.
>
> [...]
> >
:) That's what the asterisked note was for in the original question. I
don't think I can do that in the real code because the real code is much
more complex. Each node actually triggers a callback that may modify
another node. That callback is user-created, not framework created so I
have no wa
* Brian Candler [220705 09:48]:
> Have a public Set() that does the lock and then calls a private internal
> function, which assumes it's already running under the lock.
> https://go.dev/play/p/M1XuC8bxCxL
>
> On Tuesday, 5 July 2022 at 13:32:26 UTC+1 atd...@gmail.com wrote:
>
> > Hi,
> >
> > I
* atd...@gmail.com [220705 10:03]:
> :) That's what the asterisked note was for in the original question. I
> don't think I can do that in the real code because the real code is much
> more complex. Each node actually triggers a callback that may modify
> another node. That callback is user-cre
You're absolutely right. (I wrote the simplified example a bit too fast and
missed that in a few places https://go.dev/play/p/9fk_yt0vkHD)
To add the general motivation, I have a reactive UI tree and need to
introduce concurrency (for when async data fetching is done and the data is
reintroduc
This is a recipe for bad bugs. Use defensive programming - grab the lock in the
top-level functions, have private functions like ‘doWithLock()’ as a signal
to the developer that they must be holding the lock.
Allowing callbacks to call back into a concurrent safe structure is very
difficult
I would put all of the mutations on a queue so they are single threaded.
> On Jul 5, 2022, at 9:51 AM, robert engels wrote:
>
> This is a recipe for bad bugs. Use defensive programming - grab the lock in
> the top-level functions, have private functions like ‘doWithLock()’ as a
> signal to
At the default URL https://pkg.go.dev/fmt the same thing happens for me
too. However, at https://pkg.go.dev/fmt@master it formats correctly
(pre-formatted block like in the source). So I assume this has been fixed
and the default will be updated soon (when 1.19 comes out?).
-Ben
On Tuesday, Ju
Hi Folks,
I have a go program that reads some network packets from an interface (not
using pcap).
Some of packets has 802.1Q encapsulation and some of them has not. I’m
searching a way to figure out index of IP layer dynamically from whole
packet.(gopacket.Packet.Bytes())
e.g. IP layer starts fr
Other flags is fixed in Go 1.19: https://pkg.go.dev/fmt@go1.19beta1
Peter
On Tuesday, July 5, 2022 at 5:47:55 PM UTC-4 ben...@gmail.com wrote:
> At the default URL https://pkg.go.dev/fmt the same thing happens for me
> too. However, at https://pkg.go.dev/fmt@master it formats correctly
> (pre-
13 matches
Mail list logo