summaryrefslogtreecommitdiffstatshomepage
path: root/unix/moduselect.c
Commit message (Collapse)AuthorAge
* all: Use the name MicroPython consistently in commentsAlexander Steffen2017-07-31
| | | | | There were several different spellings of MicroPython present in comments, when there should be only one.
* unix/moduselect: Properly implement ipoll object iteration.Paul Sokolovsky2017-03-05
| | | | | TODO: There's another issue to care about: poll set being modified during iteration.
* py: Add iter_buf to getiter type method.Damien George2017-02-16
| | | | | | | | | | | | | | | Allows to iterate over the following without allocating on the heap: - tuple - list - string, bytes - bytearray, array - dict (not dict.keys, dict.values, dict.items) - set, frozenset Allows to call the following without heap memory: - all, any, min, max, sum TODO: still need to allocate stack memory in bytecode for iter_buf.
* unix/moduselect: Implement ipoll() method with no-allocation policy.Paul Sokolovsky2017-02-13
| | | | | | | | | ipoll() allows to poll streams without allocating any memory: this method returns an iterator (a poll object itself), and the iterator yields preallocated "callee-owned tuple" with polling results for each active stream. The only operation a caller is allowed to do with this tuple is extracting values from it (storing the tuple as a whole somewhere is not allowed).
* unix/moduselect: Fix nanbox build with recent changes.Paul Sokolovsky2016-12-31
|
* unix/moduselect: If file object passed to .register(), return it in .poll().Paul Sokolovsky2016-12-31
| | | | | | | | | | | This makes unix "uselect" compatible with baremetal "uselect". Previosuly, unix version accepted file/socket objects, but internally converted that to file descriptors, and that's what .poll() returned. To acheive new behavior, file-like objects are stored internally in an array, in addition to existing array of struct pollfd. This array is created only on first case of file-like object being passed to .register(). If only raw fd's are passed, there will be no additional memory used comparing to the original implementation.
* unix: Rename define for unix moduselect to MICROPY_PY_USELECT_POSIX.Paul Sokolovsky2016-11-21
| | | | | To not conflict with recently made available globally baremetal moduselect.
* unix: Use mp_raise_OSError helper function.Damien George2016-10-07
|
* all: Remove 'name' member from mp_obj_module_t struct.Damien George2016-09-22
| | | | One can instead lookup __name__ in the modules dict to get the value.
* unix: Fix build for when MICROPY_PY_SOCKET=0.Renato Aguiar2016-09-12
|
* unix/moduselect: Allow poll.register(), etc. accept fd-like objects.Paul Sokolovsky2016-08-07
| | | | | | | This includes file and socket objects, backed by Unix file descriptor. This improves compatibility with stmhal's uselect (and convenience of use), though not completely: return value from poll.poll() is still raw file descriptor.
* py: Change type signature of builtin funs that take variable or kw args.Damien George2016-01-11
| | | | | With this patch the n_args parameter is changed type from mp_uint_t to size_t.
* py: Change struct and macro for builtin fun so they can be type checked.Damien George2016-01-03
|
* unix/moduselect: Make configurable with MICROPY_PY_USELECT.Paul Sokolovsky2015-12-13
|
* unix/moduselect: Implement "one-shot" flag for poll.poll().Paul Sokolovsky2015-12-11
| | | | | | | | | After an I/O event is triggered for fd, event flags are automatically reset, so no further events are reported until new event flags are set. This is an optimization for uasyncio, required to account for coroutine semantics: each coroutine issues explicit read/write async call, and once that trigger, no events should be reported to coroutine, unless it again explicitly requests it. One-shot mode saves one linear scan over the poll array.
* unix/moduselect: register(): Allow to call with duplicate file descriptor.Paul Sokolovsky2015-12-05
| | | | | | | | | | | Per CPython docs, "Registering a file descriptor that’s already registered is not an error, and has the same effect as registering the descriptor exactly once." https://docs.python.org/3/library/select.html#select.poll.register That's somewhat ambiguous, what's implemented here is that if fd si not yet registered, it is registered. Otherwise, the effect is equivalent to modify() method.
* unix/moduselect: Support growing of poll array.Paul Sokolovsky2015-11-30
|
* py: Wrap all obj-ptr conversions in MP_OBJ_TO_PTR/MP_OBJ_FROM_PTR.Damien George2015-11-29
| | | | | | | | | This allows the mp_obj_t type to be configured to something other than a pointer-sized primitive type. This patch also includes additional changes to allow the code to compile when sizeof(mp_uint_t) != sizeof(void*), such as using size_t instead of mp_uint_t, and various casts.
* py: Add MP_ROM_* macros and mp_rom_* types and use them.Damien George2015-11-29
|
* unix/moduselect: poll.register(): Reuse freed entries in poll array.Paul Sokolovsky2015-11-29
|
* unix/moduselect: Fix bug in poll.poll() scanning loop.Paul Sokolovsky2015-11-28
|
* unix/moduselect: Initialise variable so can compile in non-debug mode.Damien George2015-11-20
|
* unix: Add "uselect" module, with poll() function.Paul Sokolovsky2015-11-17
Underlyingly, uses standard POSIX poll() for portability.