Indika Bandara Udagedara wrote: > pls consider below > > typedef int (*fun)(int, int); > int add(int a, int b) > { return a+b;} > int sub(int a, int b) > { return a-b;} > fun FUN[2]; > > FUN[0] = &add; > FUN[1] = ⊂ > > can i use FUN[0] from 2 threads at once. the functions in array are > re-entrant
As long as you aren't modifying the array after a thread starts using it, then sure. If you need to modify the array from other threads while threads could be using it, then you'll need to protect the array with a mutex (probably of the reader-writer variety). -- Thomas Hruska CubicleSoft President Ph: 517-803-4197 *NEW* MyTaskFocus 1.1 Get on task. Stay on task. http://www.CubicleSoft.com/MyTaskFocus/