About your question. Yes and No.
You can run web2py on a post (say 8000) and your CGI scripts on a
different port (say 8001) using a different web server. In this case
the web2py program can call the CGI scripts pass parameters and
receive response. Example
import urllib
data=urllib.urlopen('http://localhost:8001/myscript.cgi?
parameter=value')
(you can read more in the urllib and urllib2 documentation).
You cannot call the cgi scripts from web2py without going over http.
This is not a web2py limitation, this is a CGI one. In fact CGI
assumes that every CGI script is executed in its own process and thus
has its own folder, environment variables and stdout/stdin. Therefore
a CGI script is not thread safe and cannot be executed inside a
thread (threads shares folder, environment and IO streams). web2py
uses threads.
Hope this helps.
Massimo