Machine-translated by Google. Questions are authored in English.
Top

Discussion

Queuing a pointer to a stack variable is a fault because

  • A.the pointer would not be aligned to a word boundary
  • B.the frame is destroyed when the sending function returns
  • C.the kernel cannot copy a pointer into its own storage
  • D.the receiver cannot dereference a pointer from another task

Answer: B

By the time the receiving task runs, the sender's function has very likely returned and the storage has been reused by something else, so the receiver reads whatever now occupies it. The buffer must come from a pool, from static storage or from the heap, and its ownership must pass to the receiver.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.