Traditional operating systems do not take intoconsideration the limitations in space and energy of wirelesssensor networks. Thus, contemporary architecturaldemands in terms of power, heat, size and cost will not besatisfactorily met by such uniprocessing design. Also, thetransition to multithreaded, multi-core designs places agreater responsibility on programmers and software forimproving performance which is becoming increasinglyimportant as sensor nodes are migrating towards dualprocessor designs. By analyzing and summarizing theactivity of a system, one could locate sections of code thathave a potential to generate enhanced performance. First,this paper studies the differences between differentoperating system designs introducing a thread-drivenscheduling algorithm which focuses on the value ofpreemption to overcome the energy tradeoff brought byevent-driven systems. We then devise efficient techniquesthat will enable us to locate sections in OS code that couldbehave more efficiently when parallelized, especially interms of energy consumption. Finally, we providesimulation results that will validate our proposedtechniques.