At the London Marathon, your race number has a pen number on it, based on the estimated time you put on your entry form. I don't know how well this is policed (I started in the last pen, so I doubt anyone would bother checking whether there are faster runners in there), but I understood from the race info that anyone in, say, pen number 1 at the front, with a number 9 on their number, would be made to move back.
The numbers were pretty small, and that would make it hard to spot, but if they gave runners different coloured numbers, and got them to line up next to a specific colour, rather than an expected time, this could help sort things out a bit more. I have been at races where the time boards are hard to spot, but the barriers could be coloured to match the numbers, making it easier for people to know where they should be starting from.
I must day, watching yesterday, I firstly thought "I'd love to be there", then as I saw the huge numbers of people finishing around what I hope would be my target time for next year, I thought "maybe not". I'm pretty slow, and so I'm used to being able to run at my own pace after a mile or so. Not sure I could cope being surrounded by so many people for 13 miles!