  We consider a joint sampling and scheduling problem for optimizing data
freshness in multi-source systems. Data freshness is measured by a
non-decreasing penalty function of \emph{age of information}, where all sources
have the same age-penalty function. Sources take turns to generate update
packets, and forward them to their destinations one-by-one through a shared
channel with random delay. There is a scheduler, that chooses the update order
of the sources, and a sampler, that determines when a source should generate a
new packet in its turn. We aim to find the optimal scheduler-sampler pairs that
minimize the total-average age-penalty at delivery times (Ta-APD) and the
total-average age-penalty (Ta-AP). We prove that the Maximum Age First (MAF)
scheduler and the zero-wait sampler are jointly optimal for minimizing the
Ta-APD. Meanwhile, the MAF scheduler and a relative value iteration with
reduced complexity (RVI-RC) sampler are jointly optimal for minimizing the
Ta-AP. The RVI-RC sampler is based on a relative value iteration algorithm
whose complexity is reduced by exploiting a threshold property in the optimal
sampler. Finally, a low-complexity threshold-type sampler is devised via an
approximate analysis of Bellman's equation. This threshold-type sampler reduces
to a simple water-filling sampler for a linear age-penalty function.
