Threads error on DE910

2 thoughts on “Threads error on DE910

  1. Hi,

    I try to run a code that use threads from HE910 to DE910-DUAL v (15.00.026) and that code not works on DE910.

    Then, I try to run the script example called threadstst.py and not works properly. Only the main thread runs. This is show for SER:

    Threads tests for HE910 Python 2.7.2 ver 20120120.1

    Starting cronos #1 for 4 cycles of 2 seconds delay 

    Starting cronos #2 for 6 cycles of 1 seconds delay

    And then the module not respond anymore.

    The thread module is supported on DE910?

    If is supported, Why the example not works properly? I missing some import?

    EDIT:

    Sorry, I notice that the problem only happens when I use:

    import thread

    import threading

    this not happens in HE910, and I need use RLock() and Event() from threading.py available in Python Library Modules

    You have any idea why it does not work adding import threading?

    The problem is threading.py, try to run the example attached on a HE910 and DE910, the results are different, in DE910 the threads aren’t execute

    HE910

    thread 0 sleeps for 5 seconds<LF>
    thread 1 sleeps for 5 seconds<LF>
    END<LF>

    thread 0 woke up<LF>

    thread 1 woke up<LF>

    DE910

    END<LF>

  2. anyone has any idea that can be?

    when run the same example in DE910 I have this result:

    06-01-2016 14:57:11.918 [RX] –
    Starting cronos #1 for 4 cycles of 2 seconds delay<CR>
    Starting cronos #2 for 6 cycles of 1 seconds delay<CR>
    Cronos #1 run 1<CR><LF>

    06-01-2016 14:57:14.245 [RX] – Cronos #1 run 2<CR><LF>

    06-01-2016 14:57:16.276 [RX] – Cronos #1 run 3<CR><LF>

    06-01-2016 14:57:18.293 [RX] – Cronos #1 run 4<CR><LF>

    06-01-2016 14:57:20.324 [RX] – Cronos #2 run 1<CR><LF>

    06-01-2016 14:57:21.348 [RX] – Cronos #2 run 2<CR><LF>

    06-01-2016 14:57:22.356 [RX] – Cronos #2 run 3<CR><LF>

    06-01-2016 14:57:23.396 [RX] – Cronos #2 run 4<CR><LF>

    06-01-2016 14:57:24.404 [RX] – Cronos #2 run 5<CR><LF>

    06-01-2016 14:57:25.428 [RX] – Cronos #2 run 6<CR><LF>

    but when run in HE910 I have:

    06-01-2016 19:58:13.101 [RX] –
    Starting cronos #1 for 4 cycles of 2 seconds delay<CR>
    Starting cronos #2 for 6 cycles of 1 seconds delay<CR>
    Cronos #1 run 1<CR><LF>
    Cronos #2 run 1<CR><LF>

    06-01-2016 19:58:14.117 [RX] – Cronos #2 run 2<CR><LF>

    06-01-2016 19:58:15.115 [RX] – Cronos #1 run 2<CR><LF>
    Cronos #2 run 3<CR><LF>

    06-01-2016 19:58:16.132 [RX] – Cronos #2 run 4<CR><LF>

    06-01-2016 19:58:17.122 [RX] – Cronos #1 run 3<CR><LF>
    Cronos #2 run 5<CR><LF>

    06-01-2016 19:58:18.147 [RX] – Cronos #2 run 6<CR><LF>

    06-01-2016 19:58:19.129 [RX] – Cronos #1 run 4<CR><LF>

    Its like DE910 not have a scheduler for the threads, and only process one new thread until the main thread interrupt or the new thread finish