]> Kevux Git Server - fll/commit
Progress: Interrupt and memory allocation related changes.
authorKevin Day <thekevinday@gmail.com>
Wed, 19 May 2021 03:48:26 +0000 (22:48 -0500)
committerKevin Day <thekevinday@gmail.com>
Wed, 19 May 2021 03:48:26 +0000 (22:48 -0500)
commita7f343335a6429555a269d291bd90446f8e42be1
treec196746a65d0a5a0c888a9bc56f672b7a1e189fa
parentad4ae688c586819df1eb869b785650e5c8b7986d
Progress: Interrupt and memory allocation related changes.

I've noticed that when processing large files, the FSS programs cannot be interrupted using controlled interrupts rather than the standard interrupt signals.
The POSIX standard structure of interrupts, particularly in threads, is very poorly defined.
When a threaded program wishes to be triggered for an exit, the pthread_cancel() function works by immediately exiting the program rather than aborting.
This prevents proper deallocated and shutting down of programs, particularly those that handle interrupts.

This introduces a new f_state_t structure that allows passing a generalized state around that accepts (void *) arguments so that it is not tied to any particular implementation beyond the basic structure.
The FLL/FSS and IKI processing functions then take advantage of this and utilize the state.
There are performance concerns with this, but the need to have controlled interrupts is deemed far more important.
Furthermore, the generic function is open ended so that the caller can potentially implement some sort of optimization.

Now that an f_state_t structure exists I am finally compelled to move the allocation step functionality into this structure.
This will allow for more performance improvements (such as determining allocation step according to file size).
For large files (megabytes, gigabytes, etc..) the allocation step can be set to something large, such as 16384.
Doing so should reduce the amount of memory I/O needed for resize operations.
I have opted to use uint16_t, so there is a max step of 64k at this time.

This entire process needs additional reviewing before releasing.

I designed this with the intent to move the function parameters into the (void *) data property on the f_state_t structure.
This will allow for reducing the parameters passed.
This design will also allow for me to later on add additional state information that can be passed to the caller.

This also allows for better or more granular error handling and reporting.
More work is needed in this regard because many of the functions currently written need to utilize this (such as the recursive directory functions).

This focuses on the most basic utilization in the programs but I would like to perform file size tests so that I can at least have a very basic heuristic for determining the default allocation size for large (or small) files.

A new project fl_signal is provided with a basic interrupt callback for f_state_t as I believe a dirt simple callback will be commonly used.

The default allocation step is now broken up into large and small allocation steps.
144 files changed:
build/level_0/settings
build/level_1/settings
build/monolithic/settings
build/scripts/bootstrap-example.sh
level_0/f_account/c/account-common.h
level_0/f_console/c/console.c
level_0/f_directory/c/directory-common.h
level_0/f_directory/c/directory_type.h
level_0/f_fss/c/fss-common.h
level_0/f_fss/c/fss_comment.h
level_0/f_fss/c/fss_delimit.h
level_0/f_fss/c/fss_named.c
level_0/f_fss/c/fss_named.h
level_0/f_fss/c/fss_nest.c
level_0/f_fss/c/fss_nest.h
level_0/f_fss/c/fss_quote.h
level_0/f_fss/c/fss_set.c
level_0/f_fss/c/fss_set.h
level_0/f_iki/c/iki-common.h
level_0/f_iki/c/iki.c
level_0/f_iki/c/iki.h
level_0/f_limit/c/limit-common.h
level_0/f_memory/c/memory-common.h
level_0/f_memory/c/memory_structure.c
level_0/f_memory/c/memory_structure.h
level_0/f_serialize/c/serialize.c
level_0/f_signal/c/signal-common.h
level_0/f_status/c/status.h
level_0/f_status/c/status_array.h [deleted file]
level_0/f_status/data/build/settings
level_0/f_string/c/string_dynamic.c
level_0/f_string/c/string_dynamic.h
level_0/f_string/c/string_map.c
level_0/f_string/c/string_map.h
level_0/f_string/c/string_quantity.c
level_0/f_string/c/string_quantity.h
level_0/f_string/c/string_range.c
level_0/f_string/c/string_range.h
level_0/f_string/c/string_triple.c
level_0/f_string/c/string_triple.h
level_0/f_thread/c/thread-common.h
level_0/f_thread/c/thread.c
level_0/f_thread/c/thread.h
level_0/f_type/c/type.h
level_0/f_type_array/c/type_array-common.h
level_0/f_type_array/c/type_array.c
level_0/f_type_array/c/type_array.h
level_0/f_utf/c/utf_dynamic.c
level_0/f_utf/c/utf_dynamic.h
level_0/f_utf/c/utf_map.c
level_0/f_utf/c/utf_map.h
level_0/f_utf/c/utf_quantity.c
level_0/f_utf/c/utf_quantity.h
level_0/f_utf/c/utf_range.c
level_0/f_utf/c/utf_range.h
level_0/f_utf/c/utf_triple.c
level_0/f_utf/c/utf_triple.h
level_1/fl_directory/c/directory.h
level_1/fl_directory/c/private-directory.c
level_1/fl_environment/c/environment.c
level_1/fl_fss/c/fss_basic.c
level_1/fl_fss/c/fss_basic.h
level_1/fl_fss/c/fss_basic_list.c
level_1/fl_fss/c/fss_basic_list.h
level_1/fl_fss/c/fss_embedded_list.c
level_1/fl_fss/c/fss_embedded_list.h
level_1/fl_fss/c/fss_extended.c
level_1/fl_fss/c/fss_extended.h
level_1/fl_fss/c/fss_extended_list.c
level_1/fl_fss/c/fss_extended_list.h
level_1/fl_fss/c/private-fss.c
level_1/fl_fss/c/private-fss.h
level_1/fl_iki/c/iki.c
level_1/fl_iki/c/iki.h
level_1/fl_signal/c/signal-common.h [new file with mode: 0644]
level_1/fl_signal/c/signal.c [new file with mode: 0644]
level_1/fl_signal/c/signal.h [new file with mode: 0644]
level_1/fl_signal/data/build/defines [new file with mode: 0644]
level_1/fl_signal/data/build/dependencies [new file with mode: 0644]
level_1/fl_signal/data/build/settings [new file with mode: 0644]
level_1/fl_status/c/status.c
level_1/fl_status/c/status.h
level_2/fll_execute/c/private-execute.c
level_2/fll_fss/c/fss.c
level_2/fll_fss/c/fss_basic.c
level_2/fll_fss/c/fss_basic.h
level_2/fll_fss/c/fss_basic_list.c
level_2/fll_fss/c/fss_basic_list.h
level_2/fll_fss/c/fss_embedded_list.c
level_2/fll_fss/c/fss_embedded_list.h
level_2/fll_fss/c/fss_extended.c
level_2/fll_fss/c/fss_extended.h
level_2/fll_fss/c/fss_extended_list.c
level_2/fll_fss/c/fss_extended_list.h
level_2/fll_iki/c/private-iki.c
level_2/fll_program/c/program.c
level_2/fll_status/c/status.c
level_3/controller/c/controller.h
level_3/controller/c/private-common.c
level_3/controller/c/private-common.h
level_3/controller/c/private-controller.c
level_3/controller/c/private-entry.c
level_3/controller/c/private-rule.c
level_3/controller/c/private-rule.h
level_3/controller/c/private-thread.c
level_3/controller/c/private-thread.h
level_3/fake/c/private-build.c
level_3/fake/c/private-common.h
level_3/fake/c/private-fake.c
level_3/fake/c/private-fake.h
level_3/fake/c/private-make.c
level_3/firewall/c/firewall.c
level_3/firewall/c/firewall.h
level_3/firewall/c/private-firewall.c
level_3/fss_basic_list_read/c/private-common.h
level_3/fss_basic_list_read/c/private-fss_basic_list_read.c
level_3/fss_basic_list_write/c/private-common.h
level_3/fss_basic_list_write/c/private-fss_basic_list_write.c
level_3/fss_basic_read/c/private-common.h
level_3/fss_basic_read/c/private-fss_basic_read.c
level_3/fss_basic_write/c/private-common.h
level_3/fss_basic_write/c/private-fss_basic_write.c
level_3/fss_embedded_list_read/c/fss_embedded_list_read.c
level_3/fss_embedded_list_read/c/fss_embedded_list_read.h
level_3/fss_embedded_list_read/c/private-common.h
level_3/fss_embedded_list_read/c/private-fss_embedded_list_read.c
level_3/fss_embedded_list_read/c/private-fss_embedded_list_read.h
level_3/fss_embedded_list_write/c/private-common.h
level_3/fss_embedded_list_write/c/private-fss_embedded_list_write.c
level_3/fss_extended_list_read/c/private-common.h
level_3/fss_extended_list_read/c/private-fss_extended_list_read.c
level_3/fss_extended_list_write/c/private-common.h
level_3/fss_extended_list_write/c/private-fss_extended_list_write.c
level_3/fss_extended_read/c/private-common.h
level_3/fss_extended_read/c/private-fss_extended_read.c
level_3/fss_extended_write/c/private-common.h
level_3/fss_extended_write/c/private-fss_extended_write.c
level_3/iki_read/c/iki_read.h
level_3/iki_read/c/private-common.h
level_3/iki_read/c/private-iki_read.c
level_3/iki_read/data/build/dependencies
level_3/iki_read/data/build/settings
level_3/iki_write/c/iki_write.c
level_3/iki_write/c/private-common.h