Author Topic: FreeRTOS vs pthread  (Read 4331 times)

0 Members and 1 Guest are viewing this topic.

Offline jtronixTopic starter

  • Regular Contributor
  • *
  • Posts: 125
FreeRTOS vs pthread
« on: September 25, 2018, 06:29:01 am »
Hi,

I have used FreeRTOS little bit in few of projects and now i want to step into IoT devices. I'd gone through many of the IoT hardware vendor and found that some of them are using pthread. I google it for pthread and seen example code but don't find any much difference. Infect Texas Instruments has use FreeRTOS on low level side for implement pthread on Top level.

Can any one comment on below points
1) what is the advance of using pthread?
2) Can pthread use for Cortex-M series or low memory devices (between 128K - 512K)?
3) How pthread differ from FreeRTOS?
 

Offline Berni

  • Super Contributor
  • ***
  • Posts: 5435
  • Country: si
Re: FreeRTOS vs pthread
« Reply #1 on: September 25, 2018, 06:39:57 am »
The name pthread stands for POSIX Threads. It only works on Unix-like systems such as Linux. The pthread.h is just a API that interfaces to the built in threading features of the OS. The pthread library does not actually do any of the multithreading itself.

That being said once a library becomes popular there are always people who want to use it elsewhere too (And its nice keeping things standardized and portable) so people will often write libraries that imitate the same API on there platform of choice.

So in this case using pthread on a microcontroller requires some form of multitasking OS to be running underneath or write a version of the pthread library specific for that CPU that can do multithreading on its own. If you see both FreeRTOS and pthread used in the same project then pthread is likely just providing a standardized API to the FreeRTOS multitasking features.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->