Skip to main content

What is mtfor

"mtfor" or "multithreaded for" is a simple package that provides a for loop that automatically distributes the processing through a number of threads.

Installation

You can use pip3 to install this utility by executing:

pip3 install mtfor

Usage

The function signature is mtfor(list, function, number_of_threads). It returns your list already modified.

This example prints the result of applying my_function to my_list using 4 threads.

from mtfor import mtfor

NUM_THREADS = 4

def my_function(x):
  return x * x

my_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
modified_list = mtfor(my_list, my_function, NUM_THREADS)

print(modified_list)

Metadata

Release files for mtfor 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for mtfor 0.0.4
File Interpreter ABI Platform
mtfor-0.0.4-py3-none-any.whl Python 3 none any Details

Release files / mtfor-0.0.4-py3-none-any.whl

Download URL mtfor-0.0.4-py3-none-any.whl
Size 14.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
930f3bc1f5f6f28aaccfe812bcc7835f8b145e8c8c0ebec4b67ec8f211442b80
BLAKE2b-256 checksum
How to use checksums
5304da6ec5baac40cd23a243f7860485961fbd52aca5bd297319faebe55ce889
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8

Release history Release notifications | RSS feed

This release

0.0.4 This release

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page