Looking for a little insight on if it is possible to do something:
Given this type:
type Blah struct {
Payload []byte
}
What I'm looking for is to kick off a finalizer when a slice and all other
slices backed by the same array get GC'd.
In lieu of that, whenver the pointer to the array ba
Perhaps I wasn't clear, but I am not suggesting to use one goroutine per
table. You can limit the no. of goroutines running (say 25 at a time) by
just spawning them and wait for the entire task to complete, without
creating a worker pool of 25 goroutines. It is basically a counting
semaphore with a
Existe esse grupo em Português:
https://groups.google.com/forum/m/#!forum/golang-brasil
--
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...@g
The high level design discussions are great. But I want to point out that
the code, as written, has a race related bug.
When this line is called, the workerWg has a 0 count.
go kafkaProducerWorkers(autoCancelChan, workerWg)
It is entirely possible for the workerWg.Wait() line to be called be
I needed a way to let the database complete a few tables (max 25) at a time
without the need for the database to handle other tables in between. A
worker pool which reads one table after the other does that perfectly. That
also means that if all workers wait for the database then my whole program
w
I often choose worker pools when there is working storage to be allocated
as part of the work to be done. This way means that such data and
processing structures are naturally built and torn down right there before
and after the work-channel loop in the worker, with no repeated allocations
during r
On Friday, December 27, 2019 at 10:36:28 PM UTC-5, Ron Wahler wrote:
>
> I did look at ReadAll, but it won't return until it sees EOF. I am trying
> to find something that would return when the standard read would return. I
> get the memory part and would manage that. Any other ideas ?
>
Its un
On Sat, Dec 28, 2019 at 6:11 AM Robert Engels wrote:
>
> Spinning up a Go routine when for each piece of work may be idiomatic but it
> is far from the best practice for many situations - mainly because of cpu
> cache invalidation. Most HPC systems create worker pools by type and then
> isolate
Here is my code https://goplay.space/#z5J6i_EPWmx
I want use the code to check the availability of the proxies
After set ulimit -n 256 and run for a while i got the error socket too many
open files
ll /proc/$(ps aux|grep -v "grep"|grep './main'|awk '{print
$2}'|head)/fd|grep -v '\.\.'|gre
Spinning up a Go routine when for each piece of work may be idiomatic but it is
far from the best practice for many situations - mainly because of cpu cache
invalidation. Most HPC systems create worker pools by type and then isolate
them to cpus/cores - something you can’t do in Go.
I believe t
> (the task was to limit the whole thing to about 10% of cores)
I still don't think you needed a worker pool here. Like OP mentioned above,
you could just limit the number of goroutines executed to 10% of total
cores.
On Saturday, 28 December 2019 18:02:08 UTC+5:30, Chris Burkert wrote:
>
> Th
Certainly it's important to limit the concurrency, and in your case you
need to process the larger tasks first.
However, to me, the defining characteristic of a "worker pool" are:
1. workers are created before any tasks need to be done
2. the same worker handles multiple tasks sequentially
3. wor
There are Pros and Cons for everything in life. Some time ago I wrote a
database tool which does something per table where the runtime largely
depends on the table size. I started with one goroutine per table because
it was easy. But that put a high load on the database (the task was to
limit the w
On Friday, 27 December 2019 16:30:48 UTC, Bruno Albuquerque wrote:
>
> This might be useful too you, in any case:
>
> https://git.bug-br.org.br/bga/workerpool
>
>
I think the point from Bryan Mills' video is, "worker pool" is something of
an anti-pattern in go. goroutines are so cheap that you mi
also https://github.com/peterh/liner
--
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.
To view this discussion on the web
15 matches
Mail list logo