nm_bench_req_monitor.c
/*
* NewMadeleine
* Copyright (C) 2016-2026 (see AUTHORS file)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*/
#include "nm_bench_generic.h"
#include <nm_sendrecv_interface.h>
static void req_monitor_completion_signal(nm_sr_event_t event, const nm_sr_event_info_t*event_info, void*_ref)
{
nm_cond_status_t*p_cond = _ref;
}
{
nm_sr_request_t sreq, rreq;
nm_cond_status_t cond;
nm_cond_init(&cond, 0);
nm_sr_request_monitor_with_ref(nm_bench_common.p_session, &rreq, NM_SR_EVENT_FINALIZED, &req_monitor_completion_signal, &cond);
}
{
nm_sr_request_t sreq, rreq;
nm_cond_status_t cond;
nm_cond_init(&cond, 0);
nm_sr_request_monitor_with_ref(nm_bench_common.p_session, &rreq, NM_SR_EVENT_FINALIZED, &req_monitor_completion_signal, &cond);
nm_cond_wait(&cond, NM_STATUS_FINALIZED, nm_core_get_singleton());
}
{
.server = &req_monitor_bench_server,
.client = &req_monitor_bench_client
};
static void nm_cond_init(nm_cond_status_t *p_cond, nm_status_t bitmask)
initialize a nm_cond_status_t object
Definition nm_core_interface.h:718
static void nm_cond_signal(nm_cond_status_t *p_cond, nm_status_t bitmask)
add a bit and wake up threads waiting for it
Definition nm_core_interface.h:747
static void nm_cond_wait(nm_cond_status_t *p_cond, nm_status_t bitmask, nm_core_t p_core)
wait for the given bit to be set in the status; do active polling while waiting
Definition nm_core_interface.h:752
nm_status_t nm_cond_status_t
status with synchronization (wait/signal)
Definition nm_core_interface.h:155
static int nm_sr_request_monitor_with_ref(nm_session_t p_session, nm_sr_request_t *p_request, nm_sr_event_t mask, nm_sr_event_notifier_t notifier, void *ref)
Definition nm_sendrecv_interface.h:412
struct nm_bench_common_s nm_bench_common
static int nm_sr_swait(nm_session_t p_session, nm_sr_request_t *p_request)
Wait for the completion of a non blocking send request.
static int nm_sr_irecv(nm_session_t p_session, nm_gate_t p_gate, nm_tag_t tag, void *data, nm_len_t len, nm_sr_request_t *p_request)
Post a non blocking receive request.
Definition nm_sendrecv_interface.h:381
static int nm_sr_isend(nm_session_t p_session, nm_gate_t p_gate, nm_tag_t tag, const void *data, nm_len_t len, nm_sr_request_t *p_request)
Post a non blocking send request.
Definition nm_sendrecv_interface.h:278
Definition nm_bench_generic.h:24