Let’s have a look at the performance of 😎, 😨 and 🤔️


😎 thinks he knows everything, has reached the application development ceiling, and currently earns 10K a month

Interviewer ️ : Your resume says you are familiar with AIDL. Tell me about Oneway

😎 : What is Oneway? It has nothing to do with AIDL. I’m familiar with AIDL, which refers to cross-process communication using the AIDL interface.

Interviewer: AIDL interface methods can be modified with the Oneway modifier. Do you know what this modifier does?

😎 : Can you improve performance? I don’t think it’s necessary. I’ve never used it before and it works fine.

Interviewer: Ok, go back and wait for the announcement


😨 plays games, watches TV dramas and stays up late in his spare time. His monthly salary is 15K

Interviewer: Your resume says you are familiar with AIDL. Tell me about Oneway

😨 : AIDL interface methods, decorated with oneway, are one-way calls and do not need to wait for another process to return the result, so the method return type is allowed only void.

Interviewer: How do you understand “one-way call”? Do you know how it works?

😨 : The application process communicates with the service process through the binder driver for IPC communication. One-way means that the application process only sends data to the binder driver once and then stops and returns without waiting for the reply data; The onewayless approach waits for the binder driver to communicate with the server before sending data back to the application.

Interviewer: Send data only to Binder drivers? Are binder drivers back in use?

😨 : um… I don’t need a return value, so no reply

Interviewer: Ok, go back and wait for the announcement


🤔️ insist on learning every day and constantly improve myself. My current monthly salary is 30K

Interviewer: Your resume says you are familiar with AIDL. Tell me about Oneway

🤔️ : OneWay has two main features: asynchronous invocation and serialization processing. An asynchronous invocation is when an application sends data to a Binder driver without having to suspend the thread and wait for a response from the binder driver. Oneway is used when some system services call application processes. For example, AMS calls application processes to start activities so that the application process does time-consuming tasks without blocking system services.

Serialization means that instead of all oneway methods being executed at the same time on a server’s AIDL interface, binder drivers serialize them, queuing them up one at a time.

Interviewer: Do you know about binder agreements?

🤔️ : Yes, the graph will be more intuitive. Let me draw the graph. First, the case of non-OneWay:

If oneway is used, the client does not need to suspend the thread to wait:

Binder commands are also used regularly. All commands sent to binder drivers start with BC_ and all commands sent to binder drivers start with BR_.

Interviewer: What do you mean by client thread pending? Are there any actual CPU-consuming schedules?

🤔️ : The suspension is equivalent to Thread sleep, which is the true “sleep”. The underlying Linux system function wait_EVENT_INTERRUPtible () is called.

Interviewer: Where did you learn about the wait_event_interruptible() function?

🤔 ️ : When learning Handler mechanism, the most critical place in Handler is Looper blocking and awakening, blocking is called nativePollOnce() method, then interested in its underlying implementation, I went to understand. You also learned about the select, poll, and epoll mechanisms that Linux uses to implement blocking/awakening

Interviewer: Yes, let’s talk about something else.


What do you think of the interview performance of these three students?