Menu

deciding_thread_number_in_agent_platform

AFME
2009-09-30
2013-03-03
  • Alessio Carbone

    Alessio Carbone - 2009-09-30

    Hi guys,

    Reading AFME Programmers' Guide, I don't understand how, during creation of  an '.af' file the number of threads on agent platform is decided. In some application's example about creation of an '.af' file cited in the guide is created only a thread, in other examples two o three threads (as in the SunSPOT migration example, on the africa platform).

    When I create a new '.af' file how can I decide this number of thread? Where I can find information about this argument? the AFME programmers' guide don't say nothing about this (I think that, but I'm not sure).

    I hope that problem is clear…..

    Thanks a lot

    lucignolo

     
  • Conor

    Conor - 2009-10-01

    hi lucignolo,

    There is no hard and fast rule about the number of threads that you use. It is a design decision by the developer and will be application specific. The best approach is probably trial and error. If your application does not speed up with more threads that do not use more. If you schedule a lot of tasks, such as IO tasks, then you should probably increase the number of threads. Additionally, as you add more agents, it will probably be better to use more threads, but I would experiment a bit and see which number works best. If adding more threads do not improve performance, then reduce the number because threads use up resources. The examples in the programmers guide just use an arbitrary number of threads, as in most cases, they are quite trivial. If you have a small number of agents and do not scheduler a lot of tasks, it will be best to keep the number of threads low (maybe just 2 or 3).

    hope this helps to clarify things,
    Conor

     

Log in to post a comment.

Auth0 Logo