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
blas_exec calls blas_thread_init, which unceremoniously (and a little mysteriously) exits if pthread_create fails. The below patch clarifies the message on standard error, and raises SIGINT to give the caller a chance to handle the condition (say, by requesting fewer threads). I also took the liberty of redefining blas_thread_server to return void * (as required by pthread_create), thereby eliminating some unnecessary and potentially dangerous casts.
Ideally, a library function encountering an OS error would return an error code instead of calling exit or raise. In this case, though the calls to blas_thread_init all ignore the return code. It wasn't clear to me that blas_exec has documented semantics, either. (I didn't find documentation for it.) And it currently returns no error, so it seems likely no caller checks for one. Raising a signal gives the caller who cares something to catch instead of letting the program crash.
blas_exec calls blas_thread_init, which unceremoniously (and a little mysteriously) exits if pthread_create fails. The below patch clarifies the message on standard error, and raises
SIGINT
to give the caller a chance to handle the condition (say, by requesting fewer threads). I also took the liberty of redefining blas_thread_server to returnvoid *
(as required by pthread_create), thereby eliminating some unnecessary and potentially dangerous casts.Ideally, a library function encountering an OS error would return an error code instead of calling
exit
orraise
. In this case, though the calls to blas_thread_init all ignore the return code. It wasn't clear to me that blas_exec has documented semantics, either. (I didn't find documentation for it.) And it currently returns no error, so it seems likely no caller checks for one. Raising a signal gives the caller who cares something to catch instead of letting the program crash.The text was updated successfully, but these errors were encountered: