I have no problem using concurrent.futures if all my processes are started from different functions. But if I want to call the same function with different parameters I can't seem to get the syntax right. This is what I got so far but it doesn't work:
tasks = ((serial_port_local, serial_options_local, serial_port_remote, serial_options_remote, "local"),
(serial_port_remote, serial_options_remote, serial_port_local, serial_options_local, "remote"))
for task in zip(tasks, executor.map(serial_cross_over, tasks)):
print (task)
This is the error but I don't grok it:
TypeError: serial_cross_over() missing 4 required positional arguments: 'receive_serial_options', 'send_serial_port', 'send_serial_options', and 'source'
Actually I don't really grok why its complicated at all. Shouldn't I just be able to do:
executor.submit(some_function(parameter1))
executor.submit(some_function(parameter2))
But that doesn't work. The program hangs on the second submit. Why?