
Multithreading
#1
Posted 16 December 2012 - 12:00 PM
#2
Posted 16 December 2012 - 12:20 PM
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs
#3
Posted 16 December 2012 - 02:14 PM
- NooM likes this
ntools
TCP Listener (Beta) · FTP Server (Alpha)
Netduino Plus Go Module · Xml Parser
http://ntools.codeplex.com/
#4
Posted 16 December 2012 - 02:51 PM
#5
Posted 16 December 2012 - 03:35 PM
thank you Nicky for that hint, and i wondered why my sd card is so slow.
with threads it took me 2.5!! seconds to read 128 bytes. without just 0.6 seconds (all same code, iam just calling all threads now from main loop)
when leaving all other threads but the sd card read in main loop, i got 1.5 secs
on an empty project its 0.4secs, so not much difference
Are you sure its just the threading? I'm running 4 - 5 threads at the same time, UDP listener, webserver, serial server, main thread and sometimes a background worker to store data, I notice no (big) performance disadvantages on a standard ND+.
You know you can set priorities on your thread? I assume you have something going on in your main thread (the starting one) that keeps the other from executing.
#6
Posted 16 December 2012 - 03:49 PM
#7
Posted 16 December 2012 - 03:59 PM
Are you sure its just the threading? I'm running 4 - 5 threads at the same time, UDP listener, webserver, serial server, main thread and sometimes a background worker to store data, I notice no (big) performance disadvantages on a standard ND+.
You know you can set priorities on your thread? I assume you have something going on in your main thread (the starting one) that keeps the other from executing.
Sounds like me and Noom are experiencing the same, so I can tell:
- Main-thread: Idle
- Every second, an event raises, refreshing sensors + screen and saves data (writes 100 bytes of json (automatic parsing)) if enough time has passed.
- When ever theres data to be sent, an uploader worker sends the file with a lightweight http request (1 request line, 3 line header, 100 bytes payload).
That is basicly whats killing my NGo ... singlethreaded, it can refresh, save and send data in less than a second. Multithreaded, it kills it self.
ntools
TCP Listener (Beta) · FTP Server (Alpha)
Netduino Plus Go Module · Xml Parser
http://ntools.codeplex.com/
#8
Posted 17 December 2012 - 11:44 PM

#9
Posted 18 December 2012 - 05:33 AM
are high MCU utilization
that could be my problem, i do a lot of bitshifting (need native function for shiffting bits in Byte / Byte[] arrays

1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users