Qualcomm Interview Question
Country: India
Interview Type: In-Person
Convert the virtual address of func to physical address. Pass the physical address via IPC(shared memory) to other process. Convert back the physical address to 2nd process's virtual address space and access it
Direct sharing of function is not possible using function pointers for sure, because address space of P1 is different from P2, hence a pointer in P1 doesn't have a meaning in P2.
One way of doing it is, add the function to a library, and share the library between 2 processes. Or, just pass the numeric code that indicates the function to be called and dispatch the call with a lookup (if P2 is "calling" a function in P1)
Use Remote Procedure Calls (RPC) to call functions in another process
- Amit November 30, 2012