02-10-2013 07:05 PM
The "correct" answer is D, but my question is about answer B - "Two VIs in the API cannot perform ther operations simultaneously".
This statement is indeed false if one of the operations uses the Preview Queue Element VI to get a value for operating on, but the problem statement explicitly describes the API as, "each other VI in the API dequeues an element, performs its operations, and then re-enqueues the element." If every API function has to wait to dequeue the token (queue element) before it can operate, then any other function currently operating on the token will effectively have a semaphore on it. Right?
It seems like both D and B are true. What am I missing?
02-11-2013 07:37 AM - edited 02-11-2013 07:44 AM
You reallly should post the actual question so we don't have to go look it up.
You use a single element Queue to pass data between VIs in an API. Assume that an initialization VI creates the queue, a cleanup VI destroys it, and each other VI in the API dequeues an element, performs its operations, and then re-enqueues the element. The queue reference is passed between the VIs in the API using terminal connections. Assume that the API is used on Microsoft Windows targets. Which of the following statements is true?
a. A single element queue allocates memory when created and does not need to allocate memory afterwards
b. Two VIs in the API cannot perform their operations simultaneously
c. While waiting for an element to become available, a VI uses processor resources to poll the queue
d. The caller of the API can safely branch the queue reference wire without creating copies of the enqueued data
02-12-2013 08:53 PM - edited 02-12-2013 08:56 PM
This is probably an example of poor word choice and, Frankly I boned on this myself going through the example. so lets run though it "bottom up"
D)The caller of the API can safely branch the queue reference wire without creating copies of the enqueued data.
Duh... you will copy an I32 not the entire queue totally and unequivically true. Proof positive in the Help File or, even the Probe Watch Window
C)...a VI uses processor resources..yet we "Assume that the API is used on Microsoft Windows targets" We are not overriding the OS we are an API inside an application. Hair splitting fairly fine but..... D was True! C is not more true than D or even as true as D
B) Here is the really bad coice of words "perform their operations" especially when the question contained "each other VI in the API dequeues an element, performs its operations, and then re-enqueues the element." redefining one of the member vi's "Operations" as "Its Operations" but the member vis have specific "Operations" Wait, Dequeue, work, Enqueue. Glad NI Retired that distractor. AND D is true! so a branch could cause member vis to be doing their stuff (Waiting) at the same time, just not "performs its operations" Really poor wording. "vi perform operation" is totally ambiguous.
A)"A single element queue allocates memory when created and does not need to allocate memory afterwards" I suspect that this is true EXCEPT for SEQs containing Strings or Arrays or clusters containing strings or arrays where the handle is queued rather than the data itself. But, this bit me!
I hope that helps
10-27-2013 12:59 PM
I was thinking that for answer B, there's not stated that the timeout input to the Dequeue element function is wired or not. So if it were to be wired then that vi didn't have to wait for the queue reference. If it would use the reference however it would generate an error. A weired way of using the oneelement queue but it could explain why B is not true. But maybe it’s just like Jeff wrote, a bad choice of words.