Porting Of libupnp to embedded systems

  • Dhankar C Das
    Dhankar C Das

    Currently libupnp uses a thread pool system to mangae all the jobs to be done. Whenever a job is to be done, it is added to a pool and a thread is being created to handle the job. So a lots of thread are being created in ths system which could be a problem in embedded systems. Had those who ported libupnp to embedded system faced any problem with stack for the threads being created ? What is the stack size used while porting to embedded systems.

  • Hi,

    Thread pool can be customized when building libupnp through upnp/src/inc/config.h.

    In particular, when porting libupnp to embedded systems, you can reduce the maximum number of threads in the thread pool with MAX_THREADS. By default, maximum is 12.

    Moreover, you can also reduce the stack size used by each thread with THREAD_STACK_SIZE. By default, THREAD_STACK_SIZE is set to 0 and libupnp will use the default stack size of the system (which can be several Mbs on a PC). You can reduce this value if you want, however, on linux embedded systems, you can also reduce the default stack size of the system through ulimit -s.