Details
-
Type:
Story
-
Status: Done
-
Resolution: Done
-
Fix Version/s: None
-
Component/s: ts_main_telescope
-
Labels:
-
Story Points:2
-
Epic Link:
-
Team:Telescope and Site
-
Urgent?:No
Description
Continue the experiment with LabVIEW FPGA code and C programming using the FPGA C API Interface. Work on the comments/questions in the previous ticket DM-36940:
- check the mistakes in the code snippet comments.
- help to clarify the returned memory region in "acquire" function is in stack or heap. And the OS can reallocate the memory after the "releasing" or not. There is the problem of memory leakage or not. This demonstration can be done in another ticket.
and try to answer these questions:
- question1: what will happen if there are no elements or less than the requested elements?
- question2: what will happen if I want to release 5 elements and there are only 2 or 0 elements in the FIFO?
- question3: what will happen if I want to add more elements in the FIFO but there is no available space?
Using the "acquire' function, I got the following results:
1. Assume I want to read 1 element and there is no element in FIFO.
(a) timeout = 0. I will get the timeout error -50400 immediately (The timeout expired before the FIFO operation could complete) and I will get the "Segmentation fault" message.
(b) timeout = -1. I will wait for the element forever.
2. Assume I want to read 1 element and there is 1 element in FIFO. No matter what the timeout value is, I will get the element.
3. Assume I want to read 2 elements and there is only 1 element in FIFO.
(a) timeout = 0. I will get the timeout error -50400 immediately (The timeout expired before the FIFO operation could complete) and I will get the "Segmentation fault" message.
(b) timeout = -1. I will wait for the element forever.
I need to read and understand more about this function, how it manages the memory, and why this message appears.