All Projects → mosquito → caio

mosquito / caio

Licence: Apache-2.0 license
Linux AIO c python bindings

Programming Languages

c
50402 projects - #5 most used programming language
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to caio

IntroduceToEclicpseVert.x
This repository contains the code of Vert.x examples contained in my articles published on platforms such as kodcu.com, medium, dzone. How to run each example is described in its readme file.
Stars: ✭ 27 (-25%)
Mutual labels:  non-blocking
InitWare
The InitWare Suite of Middleware allows you to manage services and system resources as logical entities called units. Its main component is a service management ("init") system.
Stars: ✭ 164 (+355.56%)
Mutual labels:  system
Customer-Management-System-for-Coffee-Shops
𝐂𝐨𝐟𝐟𝐞𝐞 𝐒𝐡𝐨𝐩𝐬
Stars: ✭ 34 (-5.56%)
Mutual labels:  system
gatsby-remark-design-system-example
Example page for "gatsby-remark-design-system"
Stars: ✭ 13 (-63.89%)
Mutual labels:  system
hardware
Get CPU, Memory and Network informations of the running OS and its processes
Stars: ✭ 70 (+94.44%)
Mutual labels:  system
WebServer
High-performance multi-threaded tcp network server in c++11
Stars: ✭ 58 (+61.11%)
Mutual labels:  eventfd
Entia
Entia is a free, open-source, data-oriented, highly performant, parallelizable and extensible Entity-Component-System (ECS) framework written in C# especially for game development.
Stars: ✭ 28 (-22.22%)
Mutual labels:  system
Time-and-Attendance-Management-System
TMS is a full-stack website that maintains records of all employees with their personal information. It keeps track of hours worked by an employee on a particular project assigned to him. It maintains time sheets and generates detailed and summary reports of the employee time sheets. TMS also has an admin page, which can manage all the employees…
Stars: ✭ 46 (+27.78%)
Mutual labels:  system
monitor
mac 实时网速监控 bandwidh monitor
Stars: ✭ 23 (-36.11%)
Mutual labels:  system
SAMD TimerInterrupt
This library enables you to use Interrupt from Hardware Timers on an SAMD-based board. These SAMD Hardware Timers, using Interrupt, still work even if other functions are blocking. Moreover, they are much more precise (certainly depending on clock frequency accuracy) than other software timers using millis() or micros(). That's mandatory if you …
Stars: ✭ 28 (-22.22%)
Mutual labels:  non-blocking
entitas-python
Entitas ECS implementation in Python.
Stars: ✭ 41 (+13.89%)
Mutual labels:  system
online exam system
基于SSM的在线考试系统
Stars: ✭ 98 (+172.22%)
Mutual labels:  system
laravel-theme-system
Theme system for Laravel Framework.
Stars: ✭ 71 (+97.22%)
Mutual labels:  system
yaf
Yet another system fetch that is minimal and customizable
Stars: ✭ 23 (-36.11%)
Mutual labels:  system
lockfree
⚡️ lock-free utilities in Go
Stars: ✭ 109 (+202.78%)
Mutual labels:  non-blocking
university
University Management System
Stars: ✭ 15 (-58.33%)
Mutual labels:  system
ltest
A Testing Framework for LFE (successor to lfeunit)
Stars: ✭ 31 (-13.89%)
Mutual labels:  system
colony
Implementation of the colony specification for python
Stars: ✭ 23 (-36.11%)
Mutual labels:  system
Hack-System
[HackSystem/Hack System] 有趣而炫酷的模拟操作系统。An interesting and cool simulation operating system.
Stars: ✭ 35 (-2.78%)
Mutual labels:  system
TimerInterrupt
This library enables you to use Interrupt from Hardware Timers on an Arduino, such as Nano, UNO, Mega, etc. It now supports 16 ISR-based timers, while consuming only 1 hardware Timer. Timers' interval is very long (ulong millisecs). The most important feature is they're ISR-based timers. Therefore, their executions are not blocked by bad-behavin…
Stars: ✭ 76 (+111.11%)
Mutual labels:  non-blocking

Python wrapper for AIO

Warning

Native Linux aio implementation supports since 4.18 kernel version.

Python bindings for Linux AIO API and simple asyncio wrapper.

Example

import asyncio
from caio import AsyncioContext

loop = asyncio.get_event_loop()

async def main():
    # max_requests=128 by default
    ctx = AsyncioContext(max_requests=128)

    with open("test.file", "wb+") as fp:
        fd = fp.fileno()

        # Execute one write operation
        await ctx.write(b"Hello world", fd, offset=0)

        # Execute one read operation
        print(await ctx.read(32, fd, offset=0))

        # Execute one fdsync operation
        await ctx.fdsync(fd)

        op1 = ctx.write(b"Hello from ", fd, offset=0)
        op2 = ctx.write(b"async world", fd, offset=11)

        await asyncio.gather(op1, op2)

        print(await ctx.read(32, fd, offset=0))
        # Hello from async world


loop.run_until_complete(main())

Troubleshooting

The linux implementation works normal for modern linux kernel versions and file systems. So you may have problems specific for your environment. It's not a bug and might be resolved some ways:

  1. Upgrade the kernel
  2. Use compatible file system
  3. Use threads based or pure python implementation.

The caio since version 0.7.0 contains some ways to do this.

1. In runtime use the environment variable CAIO_IMPL with possible values:

  • linux - use native linux kernels aio mechanism
  • thread - use thread based implementation written in C
  • python - use pure python implementation

2. File default_implementation located near __init__.py in caio installation path. It's useful for distros package maintainers. This file might contains comments (lines starts with # symbol) and the first line should be one of linux thread or python.

Previous versions allows direct import of the target implementation.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].