Many solar filaments and prominences show short-lived horizontal threads lying parallel to the photosphere. In this work the possible link between Rayleigh-Taylor instabilities and thread lifetimes is investigated. This is done by calculating the eigenmodes of a thread modelled as a Cartesian slab under the presence of gravity. An analytical dispersion relation is derived using the incompressible assumption for the magnetohydrodynamic (MHD) perturbations. The system allows a mode that is always stable, independently of the value of the Alfv\'en speed in the thread. The character of this mode varies from being localised at the upper interface of the slab when the magnetic field is weak, to having a global nature and resembling the transverse kink mode when the magnetic field is strong. On the contrary, the slab model permits another mode that is unstable and localised at the lower interface when the magnetic field is weak. The growth rates of this mode can be very short, of the order of minutes for typical thread conditions. This Rayleigh-Taylor unstable mode becomes stable when the magnetic field is increased, and in the limit of strong magnetic field it is essentially a sausage magnetic mode. The gravity force might have a strong effect on the modes of oscillation of threads, depending on the value of the Alfv\'en speed. In the case of threads in quiescent filaments, where the Alfv\'en speed is presumably low, very short lifetimes are expected according to the slab model. In active region prominences, the stabilising effect of the magnetic tension might be enough to suppress the Rayleigh-Taylor instability for a wide range of wavelengths.