Re-entrant or non-reentrant functions

Where can I get a list of the grouping ‘DC library’, What the functions is classified as re-entrant or non-reentrant? Thanks

The Dynamic C Function Reference manual at:

http://ftp1.digi.com/support/documentation/90001215_C.pdf

has a list of all the functions. If you search for re-entrant you will see which functions require special care in multitasking setups.

Regards,
Peter

1 Like

I see from that document(Dynamic C Function Reference Manual), almost all the functions of DC are non-reentrant(can’t be used by more than one task without lost data, cant’ be interrupted at any time and continue later without loss of data).

How do DC functions can be used for preemptive multitasking? Thanks.

I would have said that the majority of the functions in the DC libraries are re-entrant and I have had no issues so far. Even some of the ones that are non re-entrant on the comms side are ok to use if they are being used for separate com ports per task or if one task is reading and another writing.

If there are issues you may need to use a mutex to protect the shared functions - the TCP/IP libraries for example do this when uCOS/II is being used and I have used these libraries from several tasks in my products without issue (I usually have a single task calling the tcp_tick() function to simplify things so that I don’t have to pepper my code with calls to it.

You will run into the same issue with your own libraries and may need to take appropriate measures (I use parts of the BACnet library from multiple tasks and have a mutex to manage the sharing.

Regards,
Peter