i create a resource manager with thread pool.
but i found a problem with this resource manager X
when processA open X, and excute i/o operation, such as my_write(…)
when processA is blocked by my_write(), processB can’t open X until my_write(…) returns.
so i rewrite my_write() as following
my_read/my_write...(...)
{
iofunc_attr_unlock(ocb->attr); <--new added
....
do_a_cost_much_time_task();
....
iofunc_attr_lock(ocb->attr); <--new added
}
now processB can open X when processA is blocked.
why it can works? where ocb->attr is locked?
second question: i tried to use sopen() to let two process to share X, but it seems do not work, processB still blocked. why?