How to make arduino call processing code function

Hi all,
I'm really new to this field, so please bear with me if I am talking crazy. I really appreciate it...

So I have this piece of Processing code, and a piece of Arduino code, basically I need Arduino call Processing to run the Processing code after the Arduino code is executed.

Any idea how I can do that?

Thanks in advance!

You make the arduino send a message through the serial port when it is time to run the processing function.
Processing looks at the serial port and calls the function when it sees the message.