[go-nuts] Windows 'Access is denied' for os.Remove after exec.Output()

2020-08-14 Thread Atakan Çolak
Hello dear fellow gophers, 

I had a relatively simple yet quite inconvenient issue which I felt the 
need to ask here. In my main() function;

os.Remove("my.exe") // err is nil, my.exe is removed

works in Windows without any errors, but when I call exec beforehand, I get 
access is denied error;

buffer, err := exec.Command("my.exe", myArgs...).Output() // err is nil 
here, I get desired output
os.Remove("my.exe") // remove "C:\\...\my.exe": Access is denied

I tried using cmd.Process.Kill(), cmd.Process.Wait(), 
cmd.Start()-ioutil.ReadlAll()-cmd.Wait() alternatives as well. I kept 
getting no errors until 'Access is denied'. 

I'm using go1.14 linux/amd64 for my compiler and Windows 10 Enterprise 
10.0.18362.

Thank you.

-- 
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 visit 
https://groups.google.com/d/msgid/golang-nuts/6b88ac39-f0a1-4eee-92d1-e63d8b55261do%40googlegroups.com.


Re: [go-nuts] Worker Pool vs. New Goroutine For Each Task

2020-07-04 Thread Atakan Çolak
Thank you, perhaps two cases are quite equivalent when used with 
semaphores. 

3 Temmuz 2020 Cuma 18:29:41 UTC+3 tarihinde Andrei Tudor Călin yazdı:
>
> Check out Bryan's talk[0], in particular from ~27:00 onward, where worker 
> pools are discussed. I highly recommend the entire talk.
>
> [0] https://www.youtube.com/watch?v=5zXAHh5tJqQ
>
> On Fri, Jul 3, 2020 at 5:03 PM Atakan Çolak  > wrote:
>
>> Hiya everyone, 
>>
>> I have a simple processor function that takes in data, processes it, and 
>> sends it to a fellow goroutine which will eventually write them to DB. My 
>> main concern is just to maximise current task/sec with a hard limit on CPU 
>> usage. Currently I'm using a worker pool model that share a task channel to 
>> receive their tasks. I think another alternative solution could be setting 
>> GOMAXPROCS and generate a new goroutine for each task, as Go is able to 
>> handle thousands of goroutines easily. I wanted to ask about ups and down 
>> of both of these approaches.
>>
>> Thank you.
>>
>> -- 
>> 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 golan...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/golang-nuts/567ff4bd-a99e-4af5-bd46-7859d98575cbo%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/golang-nuts/567ff4bd-a99e-4af5-bd46-7859d98575cbo%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>
>
> -- 
> Andrei Călin
>

-- 
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 visit 
https://groups.google.com/d/msgid/golang-nuts/8e2eccc0-73dd-4020-ab3d-a5575b5d4e8do%40googlegroups.com.


[go-nuts] Worker Pool vs. New Goroutine For Each Task

2020-07-03 Thread Atakan Çolak
Hiya everyone, 

I have a simple processor function that takes in data, processes it, and 
sends it to a fellow goroutine which will eventually write them to DB. My 
main concern is just to maximise current task/sec with a hard limit on CPU 
usage. Currently I'm using a worker pool model that share a task channel to 
receive their tasks. I think another alternative solution could be setting 
GOMAXPROCS and generate a new goroutine for each task, as Go is able to 
handle thousands of goroutines easily. I wanted to ask about ups and down 
of both of these approaches.

Thank you.

-- 
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 visit 
https://groups.google.com/d/msgid/golang-nuts/567ff4bd-a99e-4af5-bd46-7859d98575cbo%40googlegroups.com.


Re: [go-nuts] rpc.debugLog unexported

2019-12-09 Thread Atakan Çolak
Hi,

I had tried a similar approach for customizing golokia 
. 

Why do we need to move the imported packages code to the project directory? 
Doesn't go compile using the local copy of the imported package in GOPATH? 

What am I missing here?

8 Aralık 2019 Pazar 21:07:55 UTC+3 tarihinde dickmao yazdı:
>
> Thanks for your reply.  Do you regularly edit standard libs as described 
> (and 
> then presumably edit them back)? 
>
> I copied /usr/lib/go-1.13/net/rpc to my project directory, then changed 
> all 
> imports of "net/rpc" to "./net/rpc", and then set debugLog (in my shadow 
> copy, 
> not /usr/lib/go-1.13).  It got the job done but still felt wrong. 
>
> > Ian Lance Taylor > writes: 
>
> > On Sat, Dec 7, 2019 at 9:12 AM > 
> wrote: 
> >> 
> >> How can I turn on debugging in net/rpc/server.go? 
> >> 
> >> There is a promising variable called `debugLog` in there.  How should I 
> toggle it? 
>
> > I don't know how much it will help, but the way to toggle it is to 
> literally 
> > edit net/rpc/debug.go to set debugLog to true.  There's no mechanism for 
> > setting it dynamically. 
>
> > Ian 
>

-- 
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 visit 
https://groups.google.com/d/msgid/golang-nuts/6aebd06b-aab4-4c9a-be88-ae2d72822362%40googlegroups.com.