From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fc89c,1600804756a0bd88 X-Google-Attributes: gidfc89c,public X-Google-Thread: fee84,1600804756a0bd88 X-Google-Attributes: gidfee84,public X-Google-Thread: 11035d,1600804756a0bd88 X-Google-Attributes: gid11035d,public X-Google-Thread: 10c665,1600804756a0bd88 X-Google-Attributes: gid10c665,public X-Google-Thread: fb4a0,1600804756a0bd88 X-Google-Attributes: gidfb4a0,public X-Google-Thread: 10650a,1600804756a0bd88 X-Google-Attributes: gid10650a,public From: interbase@aol.com (Interbase) Subject: Re: Threads on different unix systems Date: 1995/07/11 Message-ID: <3tt6qc$e4t@newsbf02.news.aol.com>#1/1 X-Deja-AN: 106000349 distribution: inet sender: root@newsbf02.news.aol.com references: <805320887snz@cucumber.demon.co.uk> organization: America Online, Inc. (1-800-827-6364) reply-to: interbase@aol.com (Interbase) newsgroups: comp.unix.internals,comp.unix.sys5.r4,comp.unix.osf.osf1,comp.unix.solaris,comp.unix.unixware,comp.unix.programmer Andrew@cucumber.demon.co.uk (Andrew Gabriel) wrote: ".. on some systems the treads support is user level only. Which other systems support kernel level verses user level threads?" AIX 4.1 has kernel level support of threads. I believe (but am not sure) that Dec's Alpha series running OSF has kernel level support. In addition, Windows NT and OS/2 also have kernel level thread support. This is not an exhaustive list. "On a system which supports only user level threads, would a blocking read in one thread block the whole process? If not, how are other threads run (without kernel support)?" If indeed you do use the underlying system call - read() in this case - then yes, the process would block. One approach to handling I/O so that other threads run (without kernel support) would be to use the select() or poll() system calls to determine when I/O can be done. The library can then suspend a thread which requests I/O, do the I/O when the select() or poll() call indicates that it is possible, and re- schedule the thread afterward. To prevent blocking in certain cases, each opened file descriptor can be marked as non- blocking. For the case where a non-blocking call returns a partially filled request under conditions in which the blocking equivalent would not, the library would need some additional logic to preserve the proper semantics. COMMERCIAL: I recently posted a description of my own multi- threading library in comp.os.linux.announce. If you wish, take a look at it. If you would like further product information, give me a jingle. ========================================================= Interbase (Bryan Batten) 419 Talbert Street Playa del Rey, CA 90293 America Online: Interbase@aol.com Compuserve: 72704.1727@compuserve.com Solutions in distributed and concurrent programming