Re: [go-nuts] Unexpected pointer dereference behavior

2021-04-22 Thread Mikhail Mazurskiy
On Thu, 22 Apr 2021 at 21:27, Jan Mercl <0xj...@gmail.com> wrote: > On Thu, Apr 22, 2021 at 1:15 PM Mikhail Mazurskiy > wrote: > > > I stumbled upon this strange looking piece of code [1]. I thought it > dereferences the pointer, creating a copy of the mutex, and then cal

[go-nuts] Unexpected pointer dereference behavior

2021-04-22 Thread Mikhail Mazurskiy
Hi all, I stumbled upon this strange looking piece of code [1]. I thought it dereferences the pointer, creating a copy of the mutex, and then calls RLock() on the copy (i.e. a nop). But it does not work this way. I experimented with it [2] and [3] and it looks like my reading of code is wrong. Cou

Re: [go-nuts] Are all running goroutines killed when main ends?

2017-10-06 Thread Mikhail Mazurskiy
I wrote a library to help with this https://github.com/ash2k/stager -- 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+unsubscr...@googlegroups.com. For

[go-nuts] Maximum number of requests per HTTP connection?

2017-07-03 Thread Mikhail Mazurskiy
Hello there, Is there a way to limit the number of http requests a client will issue via a single tcp connection? I cannot find anything relevant to this question. Maybe a snippet of code to implement this... The use case is to force a highly active http connection to be closed after certain numb

Re: [go-nuts] Isn't it better just to panic when you send/recv on a nil channel instead of forever blocking?

2017-05-05 Thread Mikhail Mazurskiy
Hi, I find it very useful to be able to dynamically turn certain cases in a select statement on and off. Here are two illustrations to Jesse's comment: https://github.com/atlassian/smith/blob/2599ad0760c39962ac9caa2c46fa23810b672384/pkg/processor/worker.go#L79 https://github.com/atlassian/gostats