|
static int | _mtp3_link_free (struct mtp_link *mtp3_link) |
| Shutdown the MTP3 link gracefully if it's being freed. More...
|
|
static int | _ofd_free (struct osmo_fd *ofd) |
| Unregister a osmocom_fd from the event loop, and close it. More...
|
|
static int | event_link_down (sigtran_conn_t *conn) |
| Take down a sigtran link. More...
|
|
static int | event_link_up (TALLOC_CTX *ctx, sigtran_conn_t **out, sigtran_conn_conf_t *conf) |
| Bring up SCTP/M3UA/MTP3/SCCP. More...
|
|
static int | event_process_request (struct osmo_fd *ofd, unsigned int what) |
| Processes a request for a new pipe from a worker thread. More...
|
|
static struct osmo_fd * | ofd_create (TALLOC_CTX *ctx, int fd, osmo_cb_func func, void *data) |
| Register a new osmocom file descriptor callback. More...
|
|
int | sigtran_event_exit (void) |
| Signal that libosmo should exit. More...
|
|
static void * | sigtran_event_loop (UNUSED void *instance) |
| Enter the libosmo event loop. More...
|
|
int | sigtran_event_start (void) |
| Start the libosmo event loop. More...
|
|
int | sigtran_event_submit (struct osmo_fd *ofd, sigtran_transaction_t *txn) |
| Send response. More...
|
|
static int | sigtran_m3ua_route_from_conf (UNUSED TALLOC_CTX *ctx, struct mtp_m3ua_client_link *client, sigtran_m3ua_route_t *conf) |
| Add a route to an m3ua_association. More...
|
|
separate eventing thread to run libosmocore's event loop
- Id
- 6278db1a8aa116790bf03a75bdd213862a640cfb
libosmocore is not thread safe, none of the event loop access functions support synchronised access by multiple threads.
Writing a shim layer and overloading the libosmo functions would work but is likely to be fragile.
Instead, we run a special thread to handle all requests to SS7 entities.
This thread runs the libosmocore event loop, and select()s over the SCTP FDs libosmo* creates, and a pipe we create (to allow communication with worker threads).
You might except performance using this model to be terrible. But the fact that libosmo is entirely async, and there's no heavy crypto being performed, I suspect that this thread is unlikely to become a bottleneck.
In future when we have our own async event loop, we can look at submitting patches to libosmocore to allow integration with external event loops.
- Note
- We rely on the fact that writes to a pipe of less than PIPE_BUF, are atomic and not interleaved.
- Author
- Arran Cudbard-Bell
- Copyright
- 2016 Network RADIUS SAS (licen.nosp@m.se@n.nosp@m.etwor.nosp@m.krad.nosp@m.ius.c.nosp@m.om)
Definition in file event.c.