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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ctrl+C broken after solve #17

Closed
jackc opened this issue May 4, 2018 · 2 comments
Closed

Ctrl+C broken after solve #17

jackc opened this issue May 4, 2018 · 2 comments

Comments

@jackc
Copy link

jackc commented May 4, 2018

Once solve is called Ctrl+C will not interrupt the program. I'm guessing it does something with a signal handler or mask and never resets it.

require 'ruby-cbc'

m = Cbc::Model.new
x1, x2, x3 = m.int_var_array(3, 0..Cbc::INF)
m.maximize(10*x1 + 6*x2 + 4*x3)
m.enforce(x1 + x2 + x3 <= 100)

m.to_problem.solve # comment this line out and Ctrl+C will work

puts "Press Ctrl+C to quit"

# Ctrl+C doesn't work here if we ran solve -- need to use Ctrl+\ to kill

sleep 9999
@gverger
Copy link
Owner

gverger commented Jun 20, 2018

Hello, thanks for this issue, I fear it is from the underlying c library, and I have not been able to find a way to fix that for now.

I was thinking running it in a separate thread, but it won't run, as mentioned in #18.

@gverger
Copy link
Owner

gverger commented Feb 28, 2019

Closing it, as I have no idea on how to deal with it.
If anyone wants to take a look and solve this, I'll gladly accept any PR.

@gverger gverger closed this as completed Feb 28, 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

2 participants