Metadata-Version: 2.4
Name: cpu-heater
Version: 0.2.1
Summary: A Python parallel computing library
Author-email: SunBK201 <sunbk201gm@gmail.com>
Project-URL: Homepage, https://github.com/SunBK201/cpu-heater
Project-URL: Issues, https://github.com/SunBK201/cpu-heater/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: tqdm
Dynamic: license-file

# CPU-Heater

A Python parallel computing library.

## Install

```py
pip install cpu-heater
```

## Usage

Multiprocessing:

```py
import cpu_heater

def adder(x, y):
    return x + y

def test_cpu_heater():
    args_list = [(i, i) for i in range(114514)]
    results = cpu_heater.multiprocess(
        adder,
        args_list,
        max_workers=8,
        show_progress=True,
        timeout=10,
        desc="test",
        not_none=True,
        extend_mode=False,
    )
    assert sorted(results) == sorted([i + i for i in range(114514)])
```

Multithreading:

```py
import cpu_heater

def adder(x, y):
    return x + y

def test_cpu_heater():
    args_list = [(i, i) for i in range(114514)]
    results = cpu_heater.multithreads(
        adder,
        args_list,
        max_workers=8,
        show_progress=True,
        desc="test",
        not_none=True,
        extend_mode=False,
    )
    assert sorted(results) == sorted([i + i for i in range(114514)])
```
