Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallel execution within two separate applications not possible #148

Open
saschagrunert opened this issue Mar 29, 2019 · 0 comments
Open

Comments

@saschagrunert
Copy link

saschagrunert commented Mar 29, 2019

Hey there 馃憢 I know that pb does not have any support for parallel exectuion, but when running two dedicated applications in parallel the ioctl on /dev/tty

pb/pb_x.go

Line 77 in f907f6f

if err := unix.IoctlSetTermios(fd, ioctlWriteTermios, &newTermios); err != nil {

blocks which cause that they will never finish. So when running this with a simple go run main.go works fine:

package main

import (
	"github.com/cheggaaa/pb"
)

func main() {
	pool := pb.NewPool(&pb.ProgressBar{})

	if err := pool.Start(); err != nil {
		return
	}

	if err := pool.Stop(); err != nil {
		return
	}
}

But running this application in parallel blocks and will never finish, which should happen because both processes sharing the same /dev/tty:

> echo go run main.go > commands
> echo go run main.go >> commands
> parallel < commands
[wait]

I think this issue could be fixed with some system wide mutex but I'm not sure if this is a nice solution. :-/

@saschagrunert saschagrunert changed the title Parallel execution within two application blocks Parallel execution within two separate applications block Mar 29, 2019
@saschagrunert saschagrunert changed the title Parallel execution within two separate applications block Parallel execution within two separate applications not possible Mar 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant