[Osip] RE: OSIP thread synchronization?
Tal Cohen
talc10 at hotmail.com
Tue Feb 26 10:48:43 CET 2008
Hi Aymeric,
I have compiled the application with DOSIP_MT definition and it works well!!!
This has made my day, my week, ...
Thanks a lot for the help,
Tal> From: osip-request at atosc.org> Subject: Osip Digest, Vol 56, Issue 14> To: osip at atosc.org> Date: Mon, 25 Feb 2008 12:00:08 +0100> > Send Osip mailing list submissions to> osip at atosc.org> > To subscribe or unsubscribe via the World Wide Web, visit> http://www.atosc.org/mailinglist/listinfo/osip> or, via email, send a message with subject or body 'help' to> osip-request at atosc.org> > You can reach the person managing the list at> osip-owner at atosc.org> > When replying, please edit your Subject line so it is more specific> than "Re: Contents of Osip digest..."> > > Today's Topics:> > 1. OSIP thread synchronization? (Tal Cohen)> 2. Re: OSIP thread synchronization? (Aymeric Moizard)> 3. RE: OSIP thread synchronization? (Tal Cohen)> 4. RE: OSIP thread synchronization? (Aymeric Moizard)> 5. how to start eXosip with visual studio 2005 (samkol chea)> > > ----------------------------------------------------------------------> > Message: 1> Date: Sun, 24 Feb 2008 13:14:20 +0000> From: Tal Cohen <talc10 at hotmail.com>> Subject: [Osip] OSIP thread synchronization?> To: <osip at atosc.org>> Message-ID: <BAY142-W10EA6D83EE45A587EE6224D41F0 at phx.gbl>> Content-Type: text/plain; charset="iso-8859-1"> > > Hi,> > I have written an application when runs 2 different threads which are being used when new SIP packet arrives:> Each thread holds it's own osip_message_t object. This object is being initialized (osip_message_init), then a SIP message is being parsed into this object (osip_message_parse), then modifications are being made on it (using: osip_message_append_via, osip_list_remove, osip_list_add, osip_message_set_body, osip_message_force_update, osip_message_to_str, ...) and last it is being released by using osip_message_free function.> > It seems that the application is stable only when the oSIP objects are being used in one thread. However, when both threads are busy handling SIP messages at the same time, the application fails (exceptions are being caught, for example on osip_message_init and on osip_message_parse functions.> Do I need to use any thread synchronization objects with the described above (although 2 different osip_message_t instances are being used)?> If so, does oSIP library provides this support?> Do I have to add any special definitions to the compiler when running multi-threaded oSIP application?> > Thanks in advance,> > Regards,> Tal> > _________________________________________________________________> Connect and share in new ways with Windows Live.> http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_012008> > ------------------------------> > Message: 2> Date: Sun, 24 Feb 2008 14:25:18 +0100 (CET)> From: Aymeric Moizard <jack at atosc.org>> Subject: Re: [Osip] OSIP thread synchronization?> To: Tal Cohen <talc10 at hotmail.com>> Cc: osip at atosc.org> Message-ID: <Pine.LNX.4.63.0802241419180.7011 at sip2>> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed> > > > On Sun, 24 Feb 2008, Tal Cohen wrote:> > >> > Hi,> >> > I have written an application when runs 2 different threads which are > > being used when new SIP packet arrives: Each thread holds it's own > > osip_message_t object. This object is being initialized > > (osip_message_init), then a SIP message is being parsed into this object > > (osip_message_parse), then modifications are being made on it (using: > > osip_message_append_via, osip_list_remove, osip_list_add, > > osip_message_set_body, osip_message_force_update, osip_message_to_str, > > ...) and last it is being released by using osip_message_free function.> >> > It seems that the application is stable only when the oSIP objects are > > being used in one thread. However, when both threads are busy handling > > SIP messages at the same time, the application fails (exceptions are > > being caught, for example on osip_message_init and on osip_message_parse > > functions.> > If only one thread access to its own instance, there is no problem.> >From the description you provide, there is no reason why your code> should fail.> > > Do I need to use any thread synchronization objects with the described > > above (although 2 different osip_message_t instances are being used)?> > You don't need.> > > If so, does oSIP library provides this support?> > > Do I have to add any special definitions to the compiler when running > > multi-threaded oSIP application?> > If osip was compiled as mutlithreaded application, you MUST compile> your application with -DOSIP_MT. However, this is NOT a requirement> if you are using ONLY the parser (-losipparser2): it's a requirement> only for -losip2.> > tks,> Aymeric MOIZARD / ANTISIP> amsip - http://www.antisip.com> osip2 - http://www.osip.org> eXosip2 - http://savannah.nongnu.org/projects/exosip/> > > > Thanks in advance,> >> > Regards,> > Tal> >> > _________________________________________________________________> > Connect and share in new ways with Windows Live.> > http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_012008_______________________________________________> > Osip mailing list> > Osip at atosc.org> > http://www.atosc.org/mailinglist/listinfo/osip> >> >> > > > ------------------------------> > Message: 3> Date: Sun, 24 Feb 2008 13:36:25 +0000> From: Tal Cohen <talc10 at hotmail.com>> Subject: RE: [Osip] OSIP thread synchronization?> To: Aymeric Moizard <jack at atosc.org>> Cc: osip at atosc.org> Message-ID: <BAY142-W18AFBD0270987BA81C40E4D41F0 at phx.gbl>> Content-Type: text/plain; charset="iso-8859-1"> > > Hi again,> > One small question:> Does Visual Studio 2003 use the same definitions (DOSIP_MT)?> > Thanks,> Tal> Date: Sun, 24 Feb 2008 14:25:18 +0100> From: jack at atosc.org> To: talc10 at hotmail.com> CC: osip at atosc.org> Subject: Re: [Osip] OSIP thread synchronization?> > > > On Sun, 24 Feb 2008, Tal Cohen wrote:> > >> > Hi,> >> > I have written an application when runs 2 different threads which are > > being used when new SIP packet arrives: Each thread holds it's own > > osip_message_t object. This object is being initialized > > (osip_message_init), then a SIP message is being parsed into this object > > (osip_message_parse), then modifications are being made on it (using: > > osip_message_append_via, osip_list_remove, osip_list_add, > > osip_message_set_body, osip_message_force_update, osip_message_to_str, > > ...) and last it is being released by using osip_message_free function.> >> > It seems that the application is stable only when the oSIP objects are > > being used in one thread. However, when both threads are busy handling > > SIP messages at the same time, the application > fails (exceptions are > > being caught, for example on osip_message_init and on osip_message_parse > > functions.> > If only one thread access to its own instance, there is no problem.> From the description you provide, there is no reason why your code> should fail.> > > Do I need to use any thread synchronization objects with the described > > above (although 2 different osip_message_t instances are being used)?> > You don't need.> > > If so, does oSIP library provides this support?> > > Do I have to add any special definitions to the compiler when running > > multi-threaded oSIP application?> > If osip was compiled as mutlithreaded application, you MUST compile> your application with -DOSIP_MT. However, this is NOT a requirement> if you are using ONLY the parser (-losipparser2): it's a requirement> only for -losip2.> > tks,> Aymeric MOIZARD / ANTISIP> amsip - http://www.antisip.com> osip2 - http://www.osip.org> eXosip2 - http://savannah.nongnu.org/projects/exosip/> > > > T> hanks in advance,> >> > Regards,> > Tal> >> > _________________________________________________________________> > Connect and share in new ways with Windows Live.> > http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_012008_______________________________________________> > Osip mailing list> > Osip at atosc.org> > http://www.atosc.org/mailinglist/listinfo/osip> >> >> > _________________________________________________________________> Shed those extra pounds with MSN and The Biggest Loser!> http://biggestloser.msn.com/> > ------------------------------> > Message: 4> Date: Sun, 24 Feb 2008 14:44:53 +0100 (CET)> From: Aymeric Moizard <jack at atosc.org>> Subject: RE: [Osip] OSIP thread synchronization?> To: Tal Cohen <talc10 at hotmail.com>> Cc: osip at atosc.org> Message-ID: <Pine.LNX.4.63.0802241443020.7011 at sip2>> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed> > > > On Sun, 24 Feb 2008, Tal Cohen wrote:> > > Hi again,> >> > One small question:> > Does Visual Studio 2003 use the same definitions (DOSIP_MT)?> > You have to add OSIP_MT as a preprocessor macro in YOUR vcproj> ompilation option of YOUR application.> > (at least if you have compiled osip with OSIP_MT which is probably> the case for 99% of users)> > tks,> Aymeric MOIZARD / ANTISIP> amsip - http://www.antisip.com> osip2 - http://www.osip.org> eXosip2 - http://savannah.nongnu.org/projects/exosip/> > > > ------------------------------> > Message: 5> Date: Sun, 24 Feb 2008 12:14:15 -0500> From: samkol chea <sophysamkol at hotmail.com>> Subject: [Osip] how to start eXosip with visual studio 2005> To: <osip at atosc.org>> Message-ID: <BAY109-W30C674E16FEA34317542DCA51F0 at phx.gbl>> Content-Type: text/plain; charset="iso-8859-1"> > > Hi all, can anyone tell me step by step how to start the eXosip. I cannot install eXosip since the installation guide is only for Linux. I want to work with Windows. Please help. thank you before hand.> > sam> > _________________________________________________________________> > > > ------------------------------> > _______________________________________________> Osip mailing list> Osip at atosc.org> http://www.atosc.org/mailinglist/listinfo/osip> > > End of Osip Digest, Vol 56, Issue 14> ************************************>
_________________________________________________________________
Climb to the top of the charts! Play the word scramble challenge with star power.
http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_jan
More information about the Osip
mailing list