LibJob
LibJob is the python wrapper of windows's job feature, which could replace resource easily.
Using Example & Compares(when applying 100MB memory limit to given two processes):
by resource standard library:
curlimit = resource.prlimit(pid1, resource.RLIMIT_VMEM)
resource.prlimit(pid1, resource.RLIMIT_MEMLOCK, (100 * 1024 * 1024, curlimit[1]))
curlimit = resource.prlimit(pid2, resource.RLIMIT_VMEM)
resource.prlimit(pid2, resource.RLIMIT_MEMLOCK, (100 * 1024 * 1024, curlimit[1]))
by using pywin32
job = win32job.CreateJobObject(None, "")
extended_info = win32job.QueryInformationJobObject(job, win32job.JobObjectExtendedLimitInformation)
extended_info["ProcessMemoryLimit"] = 100 * 1024 * 1024
extended_info["BasicLimitInformation"]["LimitFlags"] |= win32job.JOB_OBJECT_LIMIT_PROCESS_MEMORY
win32job.SetInformationJobObject(job, win32job.JobObjectExtendedLimitInformation, extended_info)
proc = win32api.OpenProcess(win32con.PROCESS_SET_QUOTA | win32con.PROCESS_TERMINATE, False, pid1)
win32job.AssignProcessToJobObject(job, proc)
proc = win32api.OpenProcess(win32con.PROCESS_SET_QUOTA | win32con.PROCESS_TERMINATE, False, pid2)
win32job.AssignProcessToJobObject(job, proc)
by using libjob
job = libjob.Job()
job.process_memory_limit = 100 * 1024 * 1024
job.assign(pid1)
job.assign(pid2)
Metadata
Release files for libjob 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| libjob-0.1.3.tar.gz | 20.9 kB | Without provenance | Details for libjob-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| libjob-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for libjob-0.1.3-py3-none-any.whl |
Total release size: 40.6 kB
Release files / libjob-0.1.3.tar.gz
| Download URL | libjob-0.1.3.tar.gz |
|---|---|
| Size | 20.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1f54c6f5038b6e2bd366dc4018578deb7c3391e88293fde71d55f86fc268fbab
|
|
BLAKE2b-256 checksum How to use checksums |
fcf0a89ef658f837dee667dda5df6bbd623292776b192c394c5f8016523c33f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.1
|
Release files / libjob-0.1.3-py3-none-any.whl
| Download URL | libjob-0.1.3-py3-none-any.whl |
|---|---|
| Size | 19.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4a1daa4aa20e9d513d502ff48f91ac4e652e76ab6e167155668204ebddf9d1bb
|
|
BLAKE2b-256 checksum How to use checksums |
ce35abc28be3721813022712a510f32e5402eaa1d795d2206c9489150bf70331
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.1
|
Security for libjob 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.