tags:

views:

237

answers:

1

Hi,

I am posting details to my previous questions. I need to port a c/c++ codebase that already supports Linux/Mac, to VxWorks. The application uses socket, pthread, mutex and critical section handling APIs.

I am pretty new to VxWorks. Could you let me know what are the possible issues that could arise?

Thanks.

A: 

VxWorks provides for standard socket operations so that should be fine.
There is a pthread compatibility library that is also part of the OS. You simply have to include the pthread component.

Without more details on the mutex and critical section handling APIs, it's hard to provide details.

VxWorks has its own API for mutex and critical section, but it also provides a POSIX interface. Different versions of VxWorks match to different version of the POSIX standard.

Depending on what version of VxWorks you are using, heavy C++ STL use might be problematic (especially if you are using an old version of vxWorks).

In C++, you have to be careful of static class instances. It works fine, but I believe it increases the program size since they have to be instantiated statically and are put in the .data segment I believe.

If you have lots of dynamic C++ objects being created and destroyed, it will put more pressure on your heap. If your embedded system has a small memory footprint that might be a problem.

If you create objects on the stack, don't forget to account for this (you have to do the same in C with structs) when you create your threads (which have a fixed size stack initialized at creation time).

Benoit