[En-Nut-Discussion] Multiple Events

Dusan Ferbas dferbas at dfsoft.cz
Thu Feb 24 00:38:34 CET 2005


Hi guys,

there is a cry for this.

I have threads listening on sockets (httpd) and I want to kill these 
threads (low RAM) once telnet connection is established.

Multiple events wait (event group) can solve this easily.

---
Any idea how to kill threads from other thread ? I know only 
NutThreadSetPriority(255) from currently running thread. BTW why 
NutThreadKill is public and not only static inside thread.c ? It cannot be 
called directly from a thread.

So if thread is waiting at 
NutTcpAccept->NutTcpStatePassiveOpenEvent:    NutEventWait(&sock->so_pc_tq, 0);
(From here it returns always 0.)

Will it work if I close the socket from other thread, signalling (event, 
queue or a bit flag) that exit is required, issuing NutThreadSetPriority(255) ?

So I have to know socket numbers for threads to be killed. Does anybody use 
anything better ?



Dusan Ferbas
www.dfsoft.cz 




More information about the En-Nut-Discussion mailing list