By increasing the number of threads, the time of running the program increased
how can i solve this problem ???
Without source, or some clue what you're doing, we can only guess.
But again, these are only guesses. Always remember the first law of improving performance; if you attempt to guess where you need to optimize, you'llalmost always be incorrect. You'll need to use some sort of profiling tool to figure out where you're spending your time.
the overhead timemay beis thanks to the context switching between threads ?
if this is the problem how can i solve it ?
Have you run Cilkview? It's output may help. Provide clues. There's information in the cilktools.html file (in the doc directory) in the section "What the Profile Numbers Mean" which help you interpret the output.