From b5f37094a13ed518adc74d2ddbc71e7a5d054eb0 Mon Sep 17 00:00:00 2001 From: Damien Zammit Date: Sun, 27 Feb 2022 09:10:41 +0000 Subject: rumpdisk: Override machdev_server with multithread port management This makes rumpdisk multithreaded as much as the root filesystem pager will request. Message-Id: <20220227091013.33112-4-damien@zamaudio.com> --- rumpdisk/main.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'rumpdisk/main.c') diff --git a/rumpdisk/main.c b/rumpdisk/main.c index 8dbe505a..9a353541 100644 --- a/rumpdisk/main.c +++ b/rumpdisk/main.c @@ -93,6 +93,21 @@ static struct argp_child empty_argp_children[] = {{0}}; static struct argp rumpdisk_argp = {options, parse_opt, 0, 0, empty_argp_children}; static const struct argp *rumpdisk_argp_bootup = &rumpdisk_argp; +static void * +rumpdisk_multithread_server(void *arg) +{ + do + { + ports_manage_port_operations_multithread (machdev_device_bucket, + machdev_demuxer, + 1000 * 60 * 2, /* 2 minute thread */ + 1000 * 60 * 10, /* 10 minute server */ + 0); + } while (1); + + return NULL; +} + int main (int argc, char **argv) { @@ -122,7 +137,7 @@ main (int argc, char **argv) error (1, errno, "cannot lock all memory"); machdev_device_init (); - err = pthread_create (&t, NULL, machdev_server, NULL); + err = pthread_create (&t, NULL, rumpdisk_multithread_server, NULL); if (err) return err; pthread_detach (t); -- cgit v1.2.3