Question: I would like to use multiple (three) serial ports on an Arduino Due. Instead of polling the ports continuously, I would like to use a Serial.Event function for each of the ports. These handler functions will read out the incoming string from the port and parse the string (i.e. check for a pre-defined command and call a corresponding sub-routine). 

I was wondering what is going to happen when serial data arrives at the same time at two different ports? For example, if the program is in the process of handling/parsing the first serial message, will it interrupt/abandon this process as soon as another SerialEvent on another port is triggered? Or will it complete the first SerialEvent routine before going to the second one?

Answer: 
The built in serialEvent() function on arduino only responds to serial port 0, called just "Serial" in the code. To respond to messages on "Serial1", use serialEvent1() on the Arduino Due there also exists serialEvent2() and so on. 

EDIT: the serialEvent() handlers are not on interrupts; they run sequentially in-between loops. If the loop is blocking they do not get run, and they do not interrupt eachother.
That should be fairly simple to implement.

Each serial port has TX and RX interrupts. You just need to tie into the various interrupts.

[Here is an example](http://mbed.org/cookbook/Serial-Interrupts) for a mbed, but it should be similar (both use ARM NVIC interrupt controllers).

To be clear, this wouldn't involve touching the `serialEvent()` function stuff at all, but rather implementing what it does using your own code.

---

If you set up your own interrupt handlers, you also get the benefit of being able to control interrupt priority yourself. The ATSAM3X has 16 interrupt priority levels, and a interrupt of a higher priority can pre-empt a lower-level interrupt.

I Strongly suggest you read the [ATSAM3X datasheet](http://www.atmel.com/Images/doc11057.pdf). It describes the interrupt controller, as well as the rest of the processor peripherals.