Thread: [Asterisk-java-devel] possible bug??
Brought to you by:
srt
From: Ngo-Vi Hoai-A. <ho...@gm...> - 2008-09-18 14:08:54
Attachments:
DefaultAgiServer.java
|
Hi, I've experimented with setting poolSize and maxPoolSize on my PC (Windows XP Service Pack 3, Java 1.6.0_06, Asterisk Java 0.3.1) and found out that ThreadPoolExecutor seemed not to work properly. I've set poolSize to 1 and maximumPoolSize to 2 but the DefaultAgiServer passes only a single call to the AgiScript. Another calls will be put into the LinkedBlockingQueue and will pass to the script as soon as the previous call gets out the AgiScript. I've modified the code to set the pool by calling pool = Executors.newCachedThreadPool(new DeamonThreadFactory()) and the DefaultAgiServer passes all simultaneous calls to AgiScript (well! setting like this the pool will have no upper bound but for my test this issue is ignorable ;-) ). Is there any known bug regardings ThreadPoolExecutor?? Modified source code is attached. best regards |
From: Stefan R. <ste...@re...> - 2008-09-18 14:25:30
Attachments:
signature.asc
|
Hi, thanks for your report. Can you try the latest snapshot of Asterisk-Java 1.0.0? I think we've fixed that bug there. =Stefan Ngo-Vi Hoai-Anh wrote: > Hi, > > I've experimented with setting poolSize and maxPoolSize on my PC > (Windows XP Service Pack 3, Java 1.6.0_06, Asterisk Java 0.3.1) and > found out that ThreadPoolExecutor seemed not to work properly. > > I've set poolSize to 1 and maximumPoolSize to 2 but the DefaultAgiServer > passes only a single call to the AgiScript. Another calls will be put > into the LinkedBlockingQueue and will pass to the script as soon as the > previous call gets out the AgiScript. > > I've modified the code to set the pool by calling pool = > Executors.newCachedThreadPool(new DeamonThreadFactory()) and the > DefaultAgiServer passes all simultaneous calls to AgiScript (well! > setting like this the pool will have no upper bound but for my test this > issue is ignorable ;-) ). > > Is there any known bug regardings ThreadPoolExecutor?? > > Modified source code is attached. > > best regards -- reuter network consulting Neusser Str. 110 50760 Koeln Germany Telefon: +49 221 1305699-0 Telefax: +49 221 1305699-90 E-Mail: ste...@re... Jabber: ste...@re... WWW: http://www.reucon.com Steuernummern 215/5140/1791 USt-IdNr. DE220701760 |
From: Ngo-Vi Hoai-A. <ho...@gm...> - 2008-09-19 01:57:43
|
Hi, it works fine with 1.0.0 SNAPSHOT. It was likely a side effect of LinkedBlockingQueue. I've subtituted LinkedBlockingQueue with SynchronousQueue as in the latest SNAPSHOT and it also works fine with 0.3.1. Having a flexible cached pool could be (at least sometimes ;-)) a good idea. Can you include this to the implementation. Stefan Reuter schrieb: > Hi, > > thanks for your report. > Can you try the latest snapshot of Asterisk-Java 1.0.0? I think we've > fixed that bug there. > > =Stefan > > Ngo-Vi Hoai-Anh wrote: > >> Hi, >> >> I've experimented with setting poolSize and maxPoolSize on my PC >> (Windows XP Service Pack 3, Java 1.6.0_06, Asterisk Java 0.3.1) and >> found out that ThreadPoolExecutor seemed not to work properly. >> >> I've set poolSize to 1 and maximumPoolSize to 2 but the DefaultAgiServer >> passes only a single call to the AgiScript. Another calls will be put >> into the LinkedBlockingQueue and will pass to the script as soon as the >> previous call gets out the AgiScript. >> >> I've modified the code to set the pool by calling pool = >> Executors.newCachedThreadPool(new DeamonThreadFactory()) and the >> DefaultAgiServer passes all simultaneous calls to AgiScript (well! >> setting like this the pool will have no upper bound but for my test this >> issue is ignorable ;-) ). >> >> Is there any known bug regardings ThreadPoolExecutor?? >> >> Modified source code is attached. >> >> best regards >> > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > ------------------------------------------------------------------------ > > _______________________________________________ > Asterisk-java-devel mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel > |
From: Stefan R. <ste...@re...> - 2008-09-19 02:51:57
Attachments:
signature.asc
|
Ngo-Vi Hoai-Anh wrote: > Having a flexible cached pool could be (at least sometimes ;-)) a good > idea. Can you include this to the implementation. In 1.0.0-SNAPSHOT I've made the createPool() method protected so custom subclasses of DefaultAgiServer can override it. Is that sufficient for your requirements or what kind of inclusion do you think of? =Stefan -- reuter network consulting Neusser Str. 110 50760 Koeln Germany Telefon: +49 221 1305699-0 Telefax: +49 221 1305699-90 E-Mail: ste...@re... Jabber: ste...@re... WWW: http://www.reucon.com Steuernummern 215/5140/1791 USt-IdNr. DE220701760 |
From: Ngo-Vi Hoai-A. <ho...@gm...> - 2008-09-19 03:47:37
|
I see. Thannk a lot. Stefan Reuter schrieb: > Ngo-Vi Hoai-Anh wrote: > >> Having a flexible cached pool could be (at least sometimes ;-)) a good >> idea. Can you include this to the implementation. >> > > In 1.0.0-SNAPSHOT I've made the createPool() method protected so custom > subclasses of DefaultAgiServer can override it. > Is that sufficient for your requirements or what kind of inclusion do > you think of? > > =Stefan > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > ------------------------------------------------------------------------ > > _______________________________________________ > Asterisk-java-devel mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel > |