diff --git a/meson.build b/meson.build index 8ba62094e7829166af5287ad9a7a3eae8652215c..6979092c18d9bcdbdb676528442f9655e4850892 100644 --- a/meson.build +++ b/meson.build @@ -98,12 +98,16 @@ if option_io endif io_bool_options = [ - 'stealing', - 'lockless_cq', - 'single_uring', - 'try_syscall', - 'uring_sqpoll', - 'uring_shared_wq', + {'option': 'stealing'}, + {'option': 'lockless_cq'}, + {'option': 'single_uring', + 'dependencies': {'io_uring_shared_wq': false, + 'io_completer_behavior': 'schedule'}}, + {'option': 'try_syscall'}, + {'option': 'uring_sqpoll'}, + {'option': 'uring_shared_wq'}, + {'option': 'waitfree_stealing', + 'dependencies': {'io_stealing': true, 'io_lockless_cq': true}}, ] io_raw_options = [ @@ -111,11 +115,25 @@ io_raw_options = [ 'lockless_memory_order', ] -foreach option : io_bool_options +foreach option_dict : io_bool_options + option = option_dict['option'] value = get_option('io_' + option) - if value == true and not option_io + if not value + continue + endif + + if not option_io error('io_' + option + ' defined without io') endif + + dependencies = option_dict.get('dependencies', {}) + foreach dependency, dep_value: dependencies + if get_option(dependency) != dep_value + error('io_' + option + ' defined but dependency ' + dependency + ':' + + dep_value.to_string() + ' not satisfied') + endif + endforeach + conf_data.set('EMPER_IO_' + option.to_upper(), value) endforeach @@ -145,17 +163,6 @@ else check_anywhere_queue_while_stealing == 'true') endif -# check io meson options consistency -if get_option('io_single_uring') - if not (io_completer_behavior == 'schedule') - error('Using a single io_uring need a "scheduling" completer') - endif - - if get_option('io_uring_shared_wq') - error('Sharing io_uring ressources is useless when using a single io_uring') - endif -endif - subdir('emper') subdir('tests') subdir('apps') diff --git a/meson_options.txt b/meson_options.txt index 0bd6806b6cfcc93bf67b7ebd0b9a018c36b9ddc5..8e2b537e16b616fe10ce5e0a1378467d9fd307e8 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -186,6 +186,12 @@ option( description: 'Work-Stealing workers will also try to steal IO from other workers', value: false, ) +option( + 'io_waitfree_stealing', + type: 'boolean', + description: 'Work-Stealing workers will also try to steal waitfree IO from other workers', + value: false, +) option( 'io_lockless_cq', type: 'boolean',