Swarm-based systems have emerged as an attractive paradigm for implementing distributed autonomous systems for various applications in commercial, military and business domains. One of the major operations in a swarm-based system is to ensure that the individual swarm units process the tasks in the environment in an efficient manner. This can be achieved using a suitable task selection mechanism that allocates the desired number of swarm units to each task while reducing inter-task latencies and communication overhead, and, ensuring adequate commitment of resources to tasks. In this paper, we describe a multi-agent based distributed task selection mechanism for swarm-based systems. We show that the distributed task selection problem is NP-complete and propose polynomial-time heuristic-based algorithms. Our simulation results show that heuristics in which each swarm unit considers both the effects of other swarm units on tasks and its own relative position to other swarm units achieve better task processing efficiency and improved distribution of swarm units over tasks.