Re: [go-nuts] Understanding SyscallN for windows when doing windows api call

2024-10-25 Thread Ian Lance Taylor
On Fri, Oct 25, 2024 at 8:34 AM rudeus greyrat wrote: > > In cpp (and other LLVM based languages), the windows API function address is > taken from the DLL after it has been loaded in the Virtual Memory space (or > at least something like that). > > In go, everything is wrapped around that Sysca

[go-nuts] Understanding SyscallN for windows when doing windows api call

2024-10-25 Thread rudeus greyrat
Hello, In cpp (and other LLVM based languages), the windows API function address is taken from the DLL after it has been loaded in the Virtual Memory space (or at least something like that). In go, everything is wrapped around that SyscallN function, which sadly I am not understanding how it w

Re: [go-nuts] How to Implement Server-Sent Events in Go

2024-10-25 Thread Jesús Ruiz
If you are not using TLS end-to-end then yes, it should be applicable in 2024. Because there may be many intermediate proxies out there which may affect how it works, including the store-and-forward mentioned in the article. But you MUST use TLS for everything, and then SSE are production ready

Re: [go-nuts] Check Channel is active or not while Writing as writer Go routine

2024-10-25 Thread Robert Engels
That is exactly how the code I referenced you to works. Your structures appear inverted. When the client socket disconnects it should be removed from the structure the writer is using. If you don’t do this properly you have a race condition anyway. On Oct 25, 2024, at 7:57 AM, 'Aniket Pandey' via g

Re: [go-nuts] Check Channel is active or not while Writing as writer Go routine

2024-10-25 Thread Jason E. Aten
Hi Aniket - you probably have a race and per Robert, should restructure not to close the channel ever. We can help you more directly if you would kindly post a playground code example that illustrates the essentials of what you are doing. See https://go.dev/play/ then press Share and reply

[go-nuts] Re: Profiling the `go` tool itself?

2024-10-25 Thread jake...@gmail.com
May be related to this gonuts post . As of go 1.19 I (and others) get slow builds on Windows, apparently because of excessive file reads on every build. I was getting 2,000 standard library files read, in their entirety, to b

Re: [go-nuts] Check Channel is active or not while Writing as writer Go routine

2024-10-25 Thread 'Aniket Pandey' via golang-nuts
Thanks for the ideas guys !! but in my case i have constant running process irrespective number of writes as my writer channel won't stop sending data directly as it has only check if the client Active and that is made false once the Socket Reader function exits and after that i close the chan

Re: [go-nuts] Check Channel is active or not while Writing as writer Go routine

2024-10-25 Thread Jason E. Aten
Robert makes an insightful point. You probably don't want to be closing channels that have actual data conveyed / sent through them in the first place. Closing a channel is most often used as a means of broadcasting a state change, rather than signaling EOF (end of file). Doing for-range loop

[go-nuts] Re: Check Channel is active or not while Writing as writer Go routine

2024-10-25 Thread Jason E. Aten
Usually you just set to nil any channel you do not want to use. You do also have to typically keep track of whether a channel is closed already or not in a separate bool variable that is protected by a mutex. But anyway, a nil chan can still be used in a select. But if nil, then select {} will ig