From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,63e84d65d4999f24 X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2003-02-14 07:59:21 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.frii.net!newsfeed.frii.net!out.nntp.be!propagator2-SanJose!in.nntp.be!news.grnet.gr!news.ntua.gr!not-for-mail From: "Ioannis E. Venetis" Newsgroups: comp.unix.tru64 Subject: Re: How to create kernel-level threads in Tru64 5.1? Date: Fri, 14 Feb 2003 17:55:33 +0200 Organization: National Technical University of Athens, Greece Message-ID: References: NNTP-Posting-Host: patroclos.hpclab.ceid.upatras.gr X-Trace: ulysses.noc.ntua.gr 1045238359 17884 150.140.142.225 (14 Feb 2003 15:59:19 GMT) X-Complaints-To: usenet@ulysses.noc.ntua.gr NNTP-Posting-Date: Fri, 14 Feb 2003 15:59:19 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Xref: archiver1.google.com comp.unix.tru64:9543 Hello, > The Mach interfaces have all, officially, always been completely unsupported > on Tru64 UNIX, (in user mode), and are undocumented. You can find books on > Mach, and many papers on the web, and you CAN figure out how to use and > manipulate Mach threads. Much of which you might discover will actually > work on Tru64 UNIX... but don't bother asking anyone for help or trying to > report any problems. ;-) Well, I managed to create some kernel-threads using the Mach interface :-) The code I mentioned in my original post and some digging in the system include files helped very much. > Furthermore, if you're planning to use (or to support applications that use) > libc, librt, or other libraries (bundled or otherwise) that support > threads, beware that these are all based on carefully designed integration > between libc and libpthread, and it won't work with any other thread > library unless you can figure out (entirely on your own) how to duplicate > that support. Even if you do manage, you'll have a much harder time trying > to build an environment that could support both POSIX threads and your > package within the same process, which means you're excluding most existing > threaded code. At least some applications from the OpenMP NAS benchmark suite are running correctly. We have a compiler that creates code that uses our thread library and the CG and MG applications are terminating successfully and also get speed-up. I haven't tried other applications yet. The ps command (using the -m switch) also confirms that there are more than one threads running. Our library uses several functions from libc (printf, malloc, mmap, open, close, ...) and there seems to be no problem. Or do you mean that there might be a problem if we try to create an environment that supports both POSIX and our threads package? Anyway, this is not something that we are trying to do. > This all was of course also a problem faced by other groups that have done > "non-POSIX" thread support -- including Ada, Java, Perl, etc. Generally, > the solution has been to build their thread support on top of POSIX > threads. > > (This was really the original inspiration of POSIX threads, which is based > directly on Digital's "CMA" package, which began as a generalization of the > task and synchronization part of the VAX Ada runtime library intended > primarily to allow various threaded runtime libraries to coexist within a > process.) > > Like Ada and Java, you should be doing your "layer" in terms of standard and > supported POSIX synchronization. That's not really "3-level scheduling"; > there ought to be no need for you to try to do your own "scheduling" at > all. According to the model that our thread library implements, it is necessary to schedule the user-level threads in an explicit way on the kernel-threads. Specifically, user-level threads do not start executing as soon as they are created, they are scheduled to run when they dependancies from other threads have been satisfied. This is totally different from POSIX threads. Moreover, this library supports multi-level parallelism and several policies of scheduling different levels can be implemented, for example execute first all inner-level threads and then all outer-level threads. So, using POSIX threads as execution vehicles would require a 3-level scheduling scheme. Thank you for your comments, Ioannis E. Venetis