You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Function runWithTimeout does not kill the running thread. It only returns to host program. The thread stays running in the background.
// WARNING: does not kill the thread, we only return to host program// Thread.stop() is deprecated and cannot be used here// add option to stop thread in unsafe waydefrunWithTimeout[T](timeoutMs: Long)(f: =>T) :Option[T] = {
try {
valexecutor=Executors.newSingleThreadExecutor()
valres= executor.invokeAll(java.util.Arrays.asList(new java.util.concurrent.Callable[T] {
overridedefcall():T= f
}), timeoutMs, TimeUnit.MILLISECONDS)
executor.shutdown()
Some(res.get(0).get())
} catch {
case_: TimeoutException=>Nonecase_: java.util.concurrent.CancellationException=>None
}
}
To Reproduce
Execute test generate huge amount of code (line 568) in autotuning.scala
Expected behavior
Code generation would create opencl kernel file bigger than 150MB. Function is timed out after 5 seconds. Code generation will continue in the background.
Possible solution
Stop thread in an unsafe way.
The text was updated successfully, but these errors were encountered:
Describe the bug
Function runWithTimeout does not kill the running thread. It only returns to host program. The thread stays running in the background.
To Reproduce
Execute test generate huge amount of code (line 568) in autotuning.scala
Expected behavior
Code generation would create opencl kernel file bigger than 150MB. Function is timed out after 5 seconds. Code generation will continue in the background.
Possible solution
Stop thread in an unsafe way.
The text was updated successfully, but these errors were encountered: