Using the v1.0.0 firmware, threads appear to block each other instead of running concurrently. I created a TCP server app using one core to receive and one to send. The receiving core blocked the sending core.
The following sample program appears to run for a while on core0 and then switch and run for a while on core1 (see output below). Running this same program using the standard RP2 PICO MicroPython firmware produces the expected output (below).
I need to build an app that receives commands to control sensors and also sends changes in sensors using the ethernet port and that will require both threads so any assistance would be appreciated.
import machine, time, _thread
led = machine.Pin(25, machine.Pin.OUT)
def Core0():
count = 0
while count < 5:
for blink in range(5):
led.on()
time.sleep(1.0)
led.off()
time.sleep(1.0)
count += 1
print('cp0')
print('Core0 finished')
core1running = True
def Core1():
global core1running
count = 0
while count < 5:
for blink in range(5):
led.on()
time.sleep(0.9)
led.off()
time.sleep(0.9)
count += 1
print('cp1')
print('Core1 finished')
core1running = False
_thread.start_new_thread(Core1, ( ))
Core0()
while core1running:
time.sleep(1)
print('Done')
Using the v1.0.0 firmware, threads appear to block each other instead of running concurrently. I created a TCP server app using one core to receive and one to send. The receiving core blocked the sending core.
The following sample program appears to run for a while on core0 and then switch and run for a while on core1 (see output below). Running this same program using the standard RP2 PICO MicroPython firmware produces the expected output (below).
I need to build an app that receives commands to control sensors and also sends changes in sensors using the ethernet port and that will require both threads so any assistance would be appreciated.
Output using Wiznet firmware:
Output using RP PICO firmware: