Topology of real algebraic threefolds