H1 and H4 simultaneous - Which takes priority?

Strange situation

1) I have given a months notice and quiting my job leaving H1 (which expires on 7/31/2012 (thats when I am quiting)) and transfering to H4 on my wifes valid H1



2) I got an offer from a company, after I gave the notice, which was ready to file my H1, but has not replied to me yet, and its getting late for me to file for H4.



What will happen if I file for my H4 and then the company files for my H1?

You will move to H4 status and then to H1 status as soon as your petition is approved.