I'm not sure if that can be done using the Edison module. It might be possible, but the performance might vary. The only way to know it for sure would be testing it.
We encourage you to give it a try and share your results with the community.
Linux should be able to run the 9 processes concurrently. But I am not too sure if I could do it in a sketch?
I was reading up about the Posix thread functions and was wondering whether I should be using calls to
int pthread_create(pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine) (void *), void *arg);
OR should I be calling the following nine times? So, I can have the nine separate instances running under the OS.
system("perl home/root/instance_x.pl > /dev/ttyGS0 &")
I am entirely unsure whether either approach would be feasible.
Anyway, I have gotten my grubby hands on an Edison, so I will test and post my results here in the future. If you do however have an answer to the above to share (based on your experience), do drop a line.
Thanks in advance,
I haven't tested something like this so I'm not sure how it can be done. However, given the two approaches above, I would try using the first one since that one is used to create multiple threads. The second one is used just to execute an instance sequentially, so the first one has to end before the second one can start, or at least that's what I would expect to happen if you use the second approach.
Anyhow, go ahead and try both approaches. Trying both of them will help you to decide which one is better.
Is this documented somewhere - what is the maximum number of threads sustainable in the Edison?
The second option is actually still attractive since the PERL script makes use of the Thread::Queue module within. I will try both and let everyone know.
Unfortunately there is no documentation on this.
Once you have done your tests, post your results here so other users can check them in case they want to do something similar to you.
1 of 1 people found this helpful
As I understand you are not using threads but processes? Anyway, there is no good answer to this question. Each process or thread will take a slice of CPU time, so it depends mostly on the load each put on the CPU.
I guess a good starting point would be: your single core atom at 1GHz can run the load, so a dual core 500MHz most likely should be able to do the same.
It will most depend on the efficiency of your program and PERL itself. And the amount of data you are processing.
For instance, in C the Edison can process 300MB/sec doing base64 encode using 2 threads with OPENMP https://github.com/aklomp/base64 and almost 2GB/sec CRC32C on a single core https://github.com/htot/crc32c.
C is of course very efficient, and the above algorithms don't do I/O. So if your problem is mostly I/O constrained (I think you are connecting over ethernet) it will depend on your Wifi connection. I have seen 30Mb/sec and if you plug a USB - ethernet adapter (we use smsc95xx based) even 88Mb/sec, measured with iperf.