Search found 18 matches

by pumelo
Thu Oct 22, 2020 8:51 am
Forum: General Discussion and Questions
Topic: uctypes: how is the size of array elements defined?
Replies: 1
Views: 983

Re: uctypes: how is the size of array elements defined?

Hmm reading function uctypes_struct_size and uctypes_struct_agg_size in moductypes.c I am not sure I understand correctly: I think the definition is as follows: - if the elements of the array are scalar type the spacing of the array elements is the size of the scalar - if the elements of the array a...
by pumelo
Thu Oct 22, 2020 7:54 am
Forum: General Discussion and Questions
Topic: uctypes: how is the size of array elements defined?
Replies: 1
Views: 983

uctypes: how is the size of array elements defined?

I'm wondering how the size of array elements is determined by micropython. given the following structure, what will the spacing of the array elements be? will it be the size of the struct defined as a array element 2+2+2 bytes or will it be the offset of the last element and its size: 8+2? DATA_STRU...
by pumelo
Tue Aug 18, 2020 9:53 am
Forum: General Discussion and Questions
Topic: _thread on esp32
Replies: 3
Views: 3351

Re: _thread on esp32

Just in case somebody is still wondering about the problems I had with the thread: This problem might be due to the omission of mine to read from the socket. I opened a socked and did write to it but I never read from it. I could not reproduce the problem described above when I do read from the sock...
by pumelo
Sun Aug 02, 2020 2:53 pm
Forum: General Discussion and Questions
Topic: _thread on esp32
Replies: 3
Views: 3351

Re: _thread on esp32

Well inspecting this more I found that at some point the task priority of the main micropython task is raised to the task priority of the lwip task. And it will never revert back to it's original priority ... Which means, that the mp_thread did not actually die, but it does not get a chance to run a...
by pumelo
Thu Jul 09, 2020 9:56 pm
Forum: General Discussion and Questions
Topic: _thread on esp32
Replies: 3
Views: 3351

_thread on esp32

Sorry to raise this again: I found threads on the esp32 to be not reliable and I would like to know if anyone is using theme with success? Am I the only one to experience issues with theme? First things first: I use threads to do blocking IO operations like socket.getaddrinfo and ussl.wrap_socket. A...
by pumelo
Tue Jun 02, 2020 9:25 am
Forum: General Discussion and Questions
Topic: _thread dies when loosing network connection and socket throws oserror - GIL deadlock?
Replies: 6
Views: 3454

Re: _thread dies when loosing network connection and socket throws oserror - GIL deadlock?

does not seem to be an issue with the GIL. I modified the idle function in modmachine.c to exit the gil (this might be a good thing anyway?). Calling that function in both the loops in the main thread and the worker thread. Still the worker thread dies ... STATIC mp_obj_t machine_idle(void) { MP_THR...
by pumelo
Mon Jun 01, 2020 12:19 pm
Forum: General Discussion and Questions
Topic: _thread dies when loosing network connection and socket throws oserror - GIL deadlock?
Replies: 6
Views: 3454

Re: _thread dies when loosing network connection and socket throws oserror - GIL deadlock?

BTW: One of the tests I performed was to raise the rtos task priority of the thread task by one so the threads priority is higher than the priority of the main python task. -> Same result..
by pumelo
Sun May 31, 2020 9:40 pm
Forum: General Discussion and Questions
Topic: _thread dies when loosing network connection and socket throws oserror - GIL deadlock?
Replies: 6
Views: 3454

Re: _thread dies when loosing network connection and socket throws oserror - GIL deadlock?

Okay, I would not call this a minimal repro but this is the best thing I can come up with for now. See attachment. - The folder utrio includes a WIP port from python trio async await lib. Docs can be found here https://trio.readthedocs.io/en/stable/. - uamqtt is an async rewrite of the mqtt lib from...
by pumelo
Sun May 31, 2020 12:59 pm
Forum: General Discussion and Questions
Topic: _thread dies when loosing network connection and socket throws oserror - GIL deadlock?
Replies: 6
Views: 3454

Re: _thread dies when loosing network connection and socket throws oserror - GIL deadlock?

@TVE, thanks for offering your help. Yesterday, I tried to write code to reproduce this issue from scratch. But I failed, so clearly I have not understood where the issue originates from. This evening or tomorrow I'll approach this the other way, by defeaturing my app. Once I have the minimum code t...
by pumelo
Fri May 29, 2020 9:37 pm
Forum: General Discussion and Questions
Topic: _thread dies when loosing network connection and socket throws oserror - GIL deadlock?
Replies: 6
Views: 3454

_thread dies when loosing network connection and socket throws oserror - GIL deadlock?

Well I face a strange error and don't know where to dig for a solution (ESP32 port on ESP32 WROVER) I have a custom written event loop which has a thread worker which is used to execute blocking operations such as getaddrinfo, wlan.scan, wlan.connect, ussl.wrap and so on. The code run in the thread ...