I’m on arm64 Darwin and wanted to view the asm output for amd64 Darwin.
Using a simple hello world example, this worked and output arm asm:
$ go tool compile -S hello.go
This worked and built a full x86 binary:
$ GOARCH=amd64 go build hello.go
But this failed:
$ GOARCH=amd64 go tool compile -
Reentrant locks make any given critical section harder to understand because
you must also understand the calling pattern that led there to know which
invariants have been upheld and which may have been violated due to a
still-in-progress critical section higher up the call chain.
For example,
doesn’t encourage as much as other languages/APIs).-eliOn Nov 2, 2022, at 7:49 AM, Eli Lindsey wrote:Reentrant locks make any given critical section harder to understand because you must also understand the calling pattern that led there to know which invariants have been upheld and which may have
The x/net/http2 client doesn’t currently support receiving push promises -
https://github.com/golang/net/blob/master/http2/transport.go#L2955
The tracking task is https://github.com/golang/go/issues/18594
-eli
> On Jan 26, 2023, at 11:29 AM, cheng dong wrote:
>
> says we do a server-push from
It’s not currently possible. Some of us run with patches exposing the TLS extensions to support this use case. The relevant GitHub issue is https://github.com/golang/go/issues/32936-eli On Mar 6, 2023, at 2:14 PM, Aurora wrote:Is it possible to capture the whole TLS handshake data coming from a H
> Is there an obvious choice here? what are people using now days (March 2023)
I don’t think there’s an obvious choice, there’s three or four main libs, any
of which may be good for different uses.
Some color on confluent-kafka-go - it's a wrapper around librdkafka. librdkafka
is the main Kafka
There are a number of different options and no right or wrong answer. This was a recent blog that I thought did an excellent job of summarizing some of the more common layouts and trade offs https://appliedgo.com/blog/go-project-layout-eli On Mar 21, 2023, at 10:28 AM, Victor Giordano wrote:Hell
I’m not aware of a stable URL that always points to the latest patch release
like you described (maybe there is one and someone else will chime in), but did
want to mention that the json output from https://go.dev/dl/?mode=json is very
useful if running in an environment where you can sprinkle i
Hi Victor,
This shows that the code you linked is a shim over runtime/internal/atomic:
https://cs.opensource.google/go/go/+/refs/tags/go1.20.3:src/sync/atomic/asm.s;l=40
In runtime/internal/atomic you’ll find asm implementations specific to the
various supported architectures. For example, here
It can work, but ends up requiring reimplementing a chunk of the TLS protocol
parser and doing the same parsing twice per connection. I’d generally favor a
three line out of tree stdlib patch over that. Skimming your linked code,
you’ll also want to make sure you have proper handling of the TLS
I’m taking a stab at answering, but I didn’t quite follow your intent and may
have misunderstood your question. Please let me know if that’s the case. :)
> I'm having a hard time putting it into my code. Specifically, how to handle
> incoming new chats message and push to all web base clients. W
> - spinning up a new chatting client goroutine (mainly the quoted code
> in OP) when a new user logs in, then there will be a new net.Conn for
> the client
> - since I'm only doing server side programming and one server needs to
> serve different clients, the only way I can think of is to store
gopacket’s C bindings are for different ways of initially capturing the packets
(libpcap, pfring, and so on). I would recommend seeing if you can create a pure
Go PacketDataSource for the platform and API that you care about and reuse the
rest of gopacket’s layered decoding support. gopacket doe
net/http/httptest is a great package, either to use if your server is
http-based or to emulate if you’re testing other protocols. I’ve also found
io.Pipe to frequently be useful for this kind of testing.
I’d recommend reading through how net/http and x/net/http2 structures their
tests.
-eli
>
Float64Bits preserves the underlying representation. The numeric value of the
uint64 it returns has little significance. You’d typically use it when
serializing floats, when wanting to make manual changes to the float’s
representation, and so on.
uint64(f) cares about preserving the numeric val
Example code (note that it won’t actually execute in the playground since it’s
making network calls):
https://play.golang.com/p/V9Z-ErjgICW
My assumption was that this code is a potential data race and requires
additional synchronization on t. net/http/httptrace in particular says:
"Functions m
> Is this an expected result that with http/2, that we will be using more
> memory at the cost of multiplexing and streaming? Or am I missing something
> here?
They’re very different protocols, so it’s often not useful to directly compare.
There are aspects of http/2 (eg. hpack state) that will
The http2 client relies on the http/1.1 client doing the dial and uses its
established connections - this error shows up when the http/1.1 client has no
pooled TLS connections for the http2 client to use.
The issue is that the httptest server is using a self-signed certificate, the
client hasn’
There isn’t a great way to handle this currently - we maintain out of tree
patches to do something similar, though ours are h2 specific. The crux of the
problem is that net currently lacks a usable connection pool API (there is some
slightly newer discussion here, but it’s similar to the issue y
ost. Then when
> the 500 is encountered stop using that transport completely and create a new
> instance. Probably want to cancel any requests currently in flight.
>
> The connection pool is per transport.
>
>> On Apr 2, 2024, at 11:05 PM, Eli Lindsey wrote:
>>
&
The first few bytes on a new TLS connection will be the record layer bytes
denoting a handshake and the TLS version field, so 0x160301 or 0x160303.
ASCII-based proxy protocol v1 will start out 0x5052 etc, and binary-based proxy
protocol v2 has its own initial 12 byte signature of 0x0D0A0D0A etc.
Git blame may be helpful, and specifically commit 847d40d6998. It looks like code drifted from the comment.-eli On May 24, 2024, at 9:25 AM, Jochen Voss wrote:Hello,In the Go standard library, in the file log/slog/handler.go, I found the following code:func (h *commonHandler) clone() *commonHandl
Those are sizes from chunked encoding. -eli On Sep 13, 2024, at 9:10 AM, Peter Galbavy wrote:I am trying to add some low level tracing to a client app to validate the responses coming from a SaaS platform.When I use either http's resp.Write(os.Stderr) or httputil.DumpResponse(resp, true) I see a
ter Galbavy wrote:
>
> Makes sense and good to know, but for diag output is there any way to turn it
> off?
>
> On Friday 13 September 2024 at 14:25:19 UTC+1 Eli Lindsey wrote:
>> Those are sizes from chunked encoding.
>>
>> -eli
>>
>>>
Relaxed atomics can be significantly easier to misuse than they first appear. If this is something you’ll be working with, I’d highly recommend watching Herb Sutter’s ~3hr workshop on atomics - it will cover many of the things you seem interested in (overhead of atomics vs regular loads/stores on v
25 matches
Mail list logo