[Freeswitch-dev] bgapi takes 20ms to return job-id

Mathieu Rene mrene_lists at avgs.ca
Tue Aug 11 08:16:00 PDT 2009

I checked the commit log and it was added by anthm to fix a race  
condition, I am not sure on the details though. However, the bgapi api  
command doesn't have anything like that, you might want to try sending

api bgapi ....

and see if you get the same problem, it should return right away.

Mathieu Rene
Avant-Garde Solutions Inc
Office: + 1 (514) 664-1044 x100
Cell: +1 (514) 664-1044 x200
mrene at avgs.ca

On 11-Aug-09, at 5:55 AM, Paweł Pierścionek wrote:

> On 2009-08-11, at 10:04, Paweł Pierścionek wrote:
>> Is it possible that thread creation takes 20ms or that the job
>> thread itself gets it's CPU timeslice before the job-id gets sent
>> out (hardly possible with 4 CPU threads) ?
> Ok, found it. FS waits for the bgapi thread to get it's timeslice in a
> sanity loop before returning the job-id.
> Why parse_command waits for it to happen. Even if the thread does not
> make it in time nothing changes in the reply.
> This makes most of bgapi commands execute before the requester even
> gets the job-id back.
> Synchronous API is in that case opportunistically faster than BGAPI or
> Async EXEC which are deterministically slow.
> Pawel,
> _______________________________________________
> FreeSWITCH-dev mailing list
> FreeSWITCH-dev at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
> http://www.freeswitch.org

More information about the FreeSWITCH-dev mailing list