% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/MCIS_helpers.R
\name{parallel_dispatch}
\alias{parallel_dispatch}
\title{Internal Parallel Dispatcher for Importance Sampling}
\usage{
parallel_dispatch(
  chunk_indices,
  worker_fun,
  u_mat,
  use_threads,
  backend,
  debug.level = 0
)
}
\arguments{
\item{chunk_indices}{List of integer vectors defining sample indices
assigned to each worker.}

\item{worker_fun}{Function that evaluates a given subset of samples.}

\item{u_mat}{Matrix of samples in standard normal space.}

\item{use_threads}{Number of worker threads.}

\item{backend}{Character string specifying backend
(\code{"future"} or \code{"parallel"}).}

\item{debug.level}{Verbosity level for diagnostic output.}
}
\value{
A list containing worker evaluation results.
}
\description{
Internal helper function used by \code{MC_IS_single()} to distribute
Monte Carlo sample blocks across worker threads in a reproducible and
backend-independent manner.

The function ensures worker-invariant execution by:
\itemize{
  \item Performing deterministic chunking of sample indices,
  \item Avoiding per-worker random number generation,
  \item Supporting both \code{"future"} and \code{"parallel"} backends.
}

This abstraction isolates parallel execution from the statistical
core of the Importance Sampling algorithm.
}
\keyword{internal}
