I have a problem with floats and listings. Sometimes it happens that a listing is split over two pages and when a figure is near the listing it happens that the listing starts on the first page, on the next page the figure is on top of the second page and below the figure the listing continues. Is it possible to let the remainder of the listing be on the top of the second page and the figure start below the listing or on top of the third page?
Without a supplied example, this is untested but you can place
after the listings environment to prevent top floats on that page (or more exactly prevent top floats on a page near there, without a forced page break the timing is a bit delicate).