I don't mean to sound preachy, but the details of the class composition and management are the determining factors in deciding what should be done.
In some circumstances, a fairly broad range of student work can be included in a positive way within a class. One way is to have the more advanced students help the others. Frequently, trying to understand the difficulties of the other students greatly enlarges the "more advanced" students understanding of the subject area (especially math) and human nature. Having the advanced students work together can also work, but in an integrated class, the teacher must be creative in guiding such a group to enlarge (enrich) their understanding rather than simply going ahead faster. Most texts make some gesture in this direction, but it is rarely adequate.
Both of these have limits, usually not approached in practice in my opinion. Although throwing chairs (mentioned at one point) is not acceptable, such dramatic actions by a student are usually based as much on frustration and unmet needs as an inherent love of flying objects.