X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: bdeck AT lycos DOT co DOT uk (deckerben) Newsgroups: comp.os.msdos.djgpp Subject: Re: threads Date: 26 Oct 2003 20:16:35 -0800 Organization: http://groups.google.com Lines: 32 Message-ID: <2761b08f.0310262016.bfef6eb@posting.google.com> References: <2u7tovcdi21agllg6vuo3m3lnlhhlmsko2 AT 4ax DOT com> <3f99ca3a$0$164$cc7c7865 AT news DOT luth DOT se> NNTP-Posting-Host: 144.139.9.26 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1067228195 10307 127.0.0.1 (27 Oct 2003 04:16:35 GMT) X-Complaints-To: groups-abuse AT google DOT com NNTP-Posting-Date: Mon, 27 Oct 2003 04:16:35 +0000 (UTC) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hello, > Ben Peddell wrote: > : Since DOS does not support threads, neither does DJGPP. > > Somehow DJGPP supports threads anyway. See FAQ 22.4, subsection "* > Multi-tasking libraries and OS kernels. I am really surprised that absolutely no one has mentioned Richard Dawe's pth threads port. The build also generates a pthreads.a. It works beautifuly for PythonD, except for multi-threaded socket scripts. This would require DJGPP-pth wrappers for critical Wattcp functions, which no one has had the time to do (yet). Richard's PTH port involved porting an old Linux JMP_BUF trick for handling mutex. I have had no trouble reconfiguring the source distribution to compile using Wattcp instead of libsocket. Basic multi-threaded non-network related python scripts have been running fine. The catch is that all Python's C modules (and any DJGPP libraries they require) are recompiled as multi-threaded. Several GNU packages (like libxml2) provide pthread-specific handlers. About DOS threads 'just being simulated', aren't we splitting hairs? Windows 95's "32 bit multitasking" is simulated, too (thunking all the 16 bit commands), but nobody in the real world cared, did they? In conclusion, I think Richard's port pointed the correct way for DJGPP. Ben