{'fraction_non_alphanumeric': 0.013665594855305467, 'fraction_numerical': 0.0, 'mean_word_length': 5.0144927536231885, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Stack safe parallel recursion with paraffin

Recursion is a programming technique in which a solution can be expressed by a subroutine invoking itself either directly or indirectly. Many problems can be expressed simply using a recursive approach, however one of the drawbacks of using recursion is that it requires a stack, and often one does not know how much stack space is needed to obtain a recursive result. Stack overflow often results in spectacular failure with strange, often unrepeatable behaviour. Paraffin is a suite of generic units that can add parallelism to iterative and recursive problems. Some of the generics involve a load balancing technique described as "work-seeking". It was found that the recursive work seeking algorithm could be extended to also provide stack safety whereby the generics monitor the amount of remaining stack space and avoid stack overflow using a technique similar to load balancing. The stack safety feature also makes it attractive to consider Paraffin for use with code destined for execution on a single core. This paper describes how the recursive work-seeking algorithm was extended to provide the stack-safety feature, and then goes on to report some performance results using the generics.