Hi,
I'm a student working on a report about a piece of software (C++, linux) that I've written. The major tasks that this software executes are:
>create a string based on called function (just a couple of integers converted to 'chars')
>open a thread (using pthread_create)
- main thread: start (deadlock) timer
- new thread: execute client functions for (wireless) communication (send string to server)
>main thread checks for answer every 1 ms (if timer reaches certain limit -> cancel thread to avoid deadlock)
>return answer
I've tested the performance of this software and it appears that the communication part (everything that happens inside the new thread) took about half the time (10 ms). This means that the other half is consumed by other functions. I think that is quite a lot (the software runs on a 200 MHz ARM9 processor).
Can I conclude that this is a result of the thread that I create every time before communication? Or doesn't that take that much time? Would it be faster to create the thread only 1 time and use an infinite loop inside that polls a variable in order to know when it should execute communication routines?
Unfortunately I don't have the time to do some tests with modified software, so hopefully someone can tell me what the bottleneck is in above mentioned software (just for recommendations in the report).
Thanks in advance!
I'm a student working on a report about a piece of software (C++, linux) that I've written. The major tasks that this software executes are:
>create a string based on called function (just a couple of integers converted to 'chars')
>open a thread (using pthread_create)
- main thread: start (deadlock) timer
- new thread: execute client functions for (wireless) communication (send string to server)
>main thread checks for answer every 1 ms (if timer reaches certain limit -> cancel thread to avoid deadlock)
>return answer
I've tested the performance of this software and it appears that the communication part (everything that happens inside the new thread) took about half the time (10 ms). This means that the other half is consumed by other functions. I think that is quite a lot (the software runs on a 200 MHz ARM9 processor).
Can I conclude that this is a result of the thread that I create every time before communication? Or doesn't that take that much time? Would it be faster to create the thread only 1 time and use an infinite loop inside that polls a variable in order to know when it should execute communication routines?
Unfortunately I don't have the time to do some tests with modified software, so hopefully someone can tell me what the bottleneck is in above mentioned software (just for recommendations in the report).
Thanks in advance!
Comment