1. A method comprising: in a handheld wireless communication device: discovering one or more available resources in a communication network; dynamically assessing respective cost functions for performing a task on the handheld wireless communication device and on each of the discovered one or more available resources, each of the respective cost functions based on one or more performance factors associated with one of the discovered one or more available resources or with the handheld wireless communication device; and detecting a change in the dynamically assessed respective cost functions; and apportioning, based on the detected change in the dynamically assessed respective cost functions, the task for one or both of local execution by the handheld wireless communication device and remote execution by the discovered one or more available resources.