problems reading data from Processing in arduino

any ideas?

Yes. The strtok_r() function is quite complex, and intended for use on multithreaded systems. Since you are not using threads on the Arduino (for good reason; you can't), there is no reason to use a thread-safe version of the strtok() function. The strtok() function has two other advantages. First, it is a lot smaller. Second, it is a lot less complicated.

Finally, "but this wouldnt work for me" doesn't mean squat. The code did something. You expected it to do something. What either of those somethings is is not at all clear.

However, look at what you are doing. You are parsing a string pointed to by p. Then, you store the token in p. Then, you set p to NULL, and expect to get the next token from a NULL string. How can you possibly expect to get a token from a NULL string?