Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

extmod/utimeq.c: queue module supporting the asyncio lib for cooperative multitasking #116

Merged
merged 8 commits into from
Jan 24, 2018

Conversation

robert-hh
Copy link
Contributor

@robert-hh robert-hh commented Dec 29, 2017

Both the module utimeq.c and the asyncio lib are made by @pfalcon (Paul Sokolovsky). They create support for cooperative multitasking, in contrast to exhaustive multitasking offered by the _thead module. This PR just adds the utimeq.c module to the set of extern modules and aligns the various settings. The asyncio libs themselves requires slight changes too. The major change is caused by the diverging utime module. Some of that is addressed by the PR #115 to the utime module.

@husigeza
Copy link
Contributor

Hello,
What is the purpose of having the utimeq module alone ? Isn't that needed by the cooperative multitasking ?
Geza

@danicampora
Copy link

I believe utimeq is needed by these libraries: https://github.com/micropython/micropython-lib/tree/master/asyncio_slow

@danicampora
Copy link

@husigeza
Copy link
Contributor

Yes that's true, I missed it. The change looks good except it crashes if the size of the list passed to the pop() function is smaller than 3 because the mp_raise_TypeError() function is called with NULL value. It should be changed to something: "The list does not exist or too small!"

}
mp_obj_list_t *ret = MP_OBJ_TO_PTR(list_ref);
if (!MP_OBJ_IS_TYPE(list_ref, &mp_type_list) || ret->len < 3) {
mp_raise_TypeError(NULL);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NULL must be changed to a valid string because it makes the system crash in this form

@husigeza husigeza merged commit 70fb03c into pycom:master Jan 24, 2018
@robert-hh robert-hh deleted the utimeq branch January 25, 2018 06:53
peter-pycom added a commit that referenced this pull request May 4, 2020
X-Ryl669 pushed a commit to X-Ryl669/pycom-micropython-sigfox that referenced this pull request May 12, 2023
extmod/utimeq.c: queue module supporting the asyncio lib for cooperative multitasking
X-Ryl669 pushed a commit to X-Ryl669/pycom-micropython-sigfox that referenced this pull request May 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants