---
title: procs | CodeWeaver Docs
description: API reference for codeweaver.core.utils.procs
url: "https://docs.knitli.com/api/core/utils/procs"
type: static
generatedAt: "2026-04-17T17:21:08.327Z"
---

# procs
       [Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Futils%2Fprocs%2F.%20I%20want%20to%20ask%20questions%20about%20it.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Futils%2Fprocs%2F.%20I%20want%20to%20ask%20questions%20about%20it.)[View in Markdown](/codeweaver/api/core/utils/procs.md)       [Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Futils%2Fprocs%2F)[Share on X](https://x.com/intent/tweet?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Futils%2Fprocs%2F&text=procs)[Share on Threads](https://threads.net/intent/post?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Futils%2Fprocs%2F&text=procs)[Share on Bluesky](https://bsky.app/intent/compose?text=procs%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Futils%2Fprocs%2F)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Futils%2Fprocs%2F)[Share on Reddit](https://reddit.com/submit?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Futils%2Fprocs%2F&title=procs)[Share on Hacker News](https://news.ycombinator.com/submitlink?u=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Futils%2Fprocs%2F&t=procs)[Share on Email](mailto:?subject=procs&body=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Futils%2Fprocs%2F)[Share on WhatsApp](https://wa.me/?text=procs%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Futils%2Fprocs%2F)[Share on Telegram](https://t.me/share/url?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Futils%2Fprocs%2F&text=procs)
# `codeweaver.core.utils.procs`
[Section titled “codeweaver.core.utils.procs”](#codeweavercoreutilsprocs)
Multiprocessing and process utilities.

## Function: `asyncio_or_uvloop`
[Section titled “Function: asyncio_or_uvloop”](#function-asyncio_or_uvloop)

**

```
asyncio_or_uvloop()
```

Set uvloop as the event loop policy if available and appropriate.

## Function: `effective_cpu_count`
[Section titled “Function: effective_cpu_count”](#function-effective_cpu_count)

**

```
effective_cpu_count()
```

Get the effective number of CPUs available, considering cgroup limits.

Returns: Effective number of CPUs as a positive integer

## Function: `get_cpu_count`
[Section titled “Function: get_cpu_count”](#function-get_cpu_count)

**

```
get_cpu_count()
```

Get the number of CPUs available on the system.

NOTE: For most use cases, use `effective_cpu_count` instead to account for cgroup and other resource limits.

Returns: Number of CPUs as a positive integer

## Function: `get_optimal_workers`
[Section titled “Function: get_optimal_workers”](#function-get_optimal_workers)

**

```
get_optimal_workers()
```

Get optimal number of worker threads/processes for a task type.

Args: task_type: Type of task - “cpu” for CPU-bound, “io” for I/O-bound

Returns: Recommended number of workers

## Function: `low_priority`
[Section titled “Function: low_priority”](#function-low_priority)

**

```
low_priority()
```

Context manager to run code at low process priority.

Lowers the process priority (nice value on Unix, below-normal on Windows) for resource-intensive operations like embedding generation. This prevents the indexing process from starving other system processes.

Priority is automatically restored when exiting the context.

Example: with low_priority(): await embed_all_chunks(chunks)

Yields: None

## Function: `python_version`
[Section titled “Function: python_version”](#function-python_version)

**

```
python_version()
```

Get the current Python version tuple.

Returns: Python version tuple

## Function: `very_low_priority`
[Section titled “Function: very_low_priority”](#function-very_low_priority)

**

```
very_low_priority()
```

Context manager to run code at very low process priority.

Sets the absolute lowest priority (nice 19 on Unix, IDLE_PRIORITY_CLASS on Windows) for background operations like backup syncing that should never interfere with normal system operation.

Priority is automatically restored when exiting the context.

Example: with very_low_priority(): await sync_to_backup_store(chunks)

Yields: None