Nmap Development mailing list archives

[NSE] Thread-safety questions


From: nnposter () users sourceforge net
Date: Wed, 31 Jul 2013 0:27:25 +0000

I would like to ask a few questions about thread safety in NSE:


1. Socket use across threads

Recently I ran into an issue of nmap failing to return from
socket:connect() so I posed a question to the mailing list about
whether sockets can be used across threads. Patrick Donnelly answered
that this is indeed prohibited. Could somebody please point out where
it is documented? (I do try to RTFM but I have somehow missed it and
I wonder if there are other similar constraints.)


2. Behavior of stdnse.new_thread()

Given the collaborative threading model, is a new thread created with
stdnse.new_thread() guaranteed not to start running until the parent
thread explicitly or implicitly yields (through yield(), sleep(),
socket I/Os, mutexes, etc.)? If the answer "Yes, always", could again
somebody please point out the relevant documentation? (Source code does
not count ;-)


Thank you in advance,
nnposter
_______________________________________________
Sent through the dev mailing list
http://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/


Current thread: