[asterisk-dev] sleeping in a module

Kevin P. Fleming kpfleming at digium.com
Sat Aug 12 09:25:24 MST 2006


----- Thomas Andrews <tandrews at grok.co.za> wrote:
> Do you really think so? I would have thought that the socket on the
> odbc
> interface would block if there was a lock on the db, so why can't I
> block too?

I don't believe there is any concept of a database being 'locked' in the ODBC world normally, although certainly queries can take significant amounts of time to complete, so that's nearly the same thing.

> The thing is, if the db is locked, you have no choice but to sleep or
> give up. I'd have thought that giving up would be worse. Calling
> sched_yield() as I am should allow other threads to run enough to
> unlock
> the db..

Right. I guess my point is that the Realtime API (and the users of Realtime) don't expect or make any provisions for Realtime calls to take extended periods of time, and depending on what the API call is being made for it could cause channel signaling to break and other unexpected behavior.

-- 
Kevin P. Fleming
Senior Software Engineer
Digium, Inc.




More information about the asterisk-dev mailing list