Hello, This is my first post here. I need help with ASYNC_pause_job(). I’m writing an async engine to delegate certificate validation to a different process. Validation happens asynchronously through IPCs. To explain what I’m doing I’ll use some
“pseudo” code: // this happens in process #1 ctx = OPENSSL_malloc(sizeof(async_engine_ctx_t)); ctx->job = ASYNC_get_current_job() ctx->wait_ctx = ASYNC_get_wait_ctx(job) pipe(ctx->fds); ASYNC_WAIT_CTX_set_wait_fd(ctx->wait_ctx, ctx, ctx->fds[0], ctx, async_engine_cleanup_cb); async_validation_request(ctx->fds[1], cert, cert_len); // this starts async validation via IPC printf(“pause”) ASYNC_pause_job(); printf(“resume”) read(ctx->fds[0], &validation_result, sizeof(validation_result)); For simplicity I omitted error checks (in my runs I have no error in any of the mentioned functions). When async response comes in, via IPC, what I do is: // this happens in process #1 write(write_fd, &status, sizeof(status)); // I verified write_fd == ctx->fds[1] I see 2 different issues with this:
Is there a reliable way (only when data is really ready) and a prompt way (in order of micro/milli-seconds) to wake up from ASYNC_pause_job()? Many thanks, any help would be much appreciated. Kind Regards, Valerio Di Gregorio |