arduino master/processing slave via serial port. is it possible?

Hello everyone, I would like some suggestions for something probably simple, but the examples I found are taught to do the opposite.
I wish send data to arduino from processing, who must read values from a csv file, one line at time, via serial port.
The fact is that arduino needs time, different for each time, to perform operations based on these variables (for example, to move two motors).

So I thought that in fact it is a master-slave scheme where arduino sends a request and listens for the response from processing, which reads and sends the next line, then arduino do what it have to and make a new request.

Thank you all.

In Processing, there is an example, SerialCallResponse, that has the Arduino sending "A" to the Processing application when it is ready to receive data. The Processing application then sends some data, and waits for the Arduino to say "A" again.

How does that differ from what you need to do?

That example is easy to alter to read data from a file, and send that data to the Arduino.

Is the example i found, and it do the opposite:
Arduino send data to processing, after a request.
I need the opposite.

And, if i have to say the true, there is something i can’t understand in the two sketch:

Arduino send a byte ‘A’ to establish a contact, during the setup.
But after, in the loop, it just send data. It read the serial port, but it don’t compare the incoming byte, it just send data.

And processing, who recive data just after read an ‘A’ byte on the serial port, also write it…

Maybe, i take a mistake.

Is the example i found, and it do the opposite:
Arduino send data to processing, after a request.
I need the opposite.

The example showed how to make one side wait for the other side to be ready, before sending data. It isn’t rocket surgery to turn the logic around, to make the other side wait.

Isn't rocket surgery, is true, just programming. The two languages ??are not entirely equal, they use different syntax and commands, you can not just copy and paste. But, you can get help on the forum, and maybe see if some rockets surgeon can help you with some examples and references,that's the concept behind the open source community.