21.01.2015 Views

INtime® 3.1 Software - tenAsys

INtime® 3.1 Software - tenAsys

INtime® 3.1 Software - tenAsys

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 4: About RT programming<br />

The RT kernel uses dynamic memory allocation to free unused memory and assign<br />

freed memory to other processes. Threads within processes use dynamic memory<br />

allocation in the same manner.<br />

For example, some threads periodically need additional memory to improve<br />

efficiency such as a thread that allocates large buffers to speed up input and output<br />

operations. Such threads can release memory for other threads when they<br />

complete, as shown in the next figure.<br />

Figure 4-7. Dynamic memory allocation between threads<br />

A<br />

A<br />

<br />

B<br />

B<br />

C<br />

C<br />

<br />

D<br />

<br />

Threads A and B use memory in the process's memory pool for objects they create.<br />

Thread C completes and then deletes its objects, and releases its memory to the process's<br />

memory pool.<br />

Thread D requests memory.<br />

49

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!