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

Set timeout for read() #6

Open
sushant94 opened this issue Mar 2, 2016 · 3 comments
Open

Set timeout for read() #6

sushant94 opened this issue Mar 2, 2016 · 3 comments

Comments

@sushant94
Copy link
Owner

The current implementation waits indefinitely to read from the process pipe. It would be nice to have a configurable option to set a timeout for read from the solvers.

@chinmaydd
Copy link
Collaborator

There is no direct timeout/wait method implemented for the ChildStdout struct which we are using for reading from the process. One way to solve this problem would be using a thread which is made to sleep for a certain duration and then the output can be checked if it is generated or we can move to other libraries such as subprocess (which is a wrapper around Process/Child but with the API resembling the Python subprocess) to ease out the process. Thoughts?

@sushant94
Copy link
Owner Author

sushant94 commented May 26, 2017

Ok, we don't want the thread to wait if the output is already generated. From what I understand, your first solution will force the thread to sleep for n milli-seconds (or whatever) regardless of the output being generated before. If you can avoid this, then the solution seems fine.

@chinmaydd
Copy link
Collaborator

Having managed a way to set a timeout, is it advisable to change the solve and check_sat methods since it will break the current API? I thought maybe we could have a solve_with_timeout instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants