rubyists-
does anyone know how to specify SA_RESTART in the signal mask such that
interupted system calls are automatically restarted on solaris, as they are on
linux?
-a
···
–
====================================
Ara Howard
NOAA Forecast Systems Laboratory
Information and Technology Services
Data Systems Group
R/FST 325 Broadway
Boulder, CO 80305-3328
Email: ahoward@fsl.noaa.gov
Phone: 303-497-7238
Fax: 303-497-7259
====================================
if that is the case, then shouldn’t it be impossible for system calls to fail
with EINTR? (see thread regarding solaris/flock for history)
-a
···
On Thu, 30 Jan 2003 nobu.nokada@softhome.net wrote:
Hi,
At Thu, 30 Jan 2003 02:07:00 +0900, > ahoward wrote:
does anyone know how to specify SA_RESTART in the signal mask such that
interupted system calls are automatically restarted on solaris, as they are on
linux?
If all of sigprocmask, sigaction and SA_RESTART are available,
ruby always sets it.
–
====================================
Ara Howard
NOAA Forecast Systems Laboratory
Information and Technology Services
Data Systems Group
R/FST 325 Broadway
Boulder, CO 80305-3328
Email: ahoward@fsl.noaa.gov
Phone: 303-497-7238
Fax: 303-497-7259
====================================
ahoward wrote:
Hi,
does anyone know how to specify SA_RESTART in the signal mask such that
interupted system calls are automatically restarted on solaris, as they are on
linux?
If all of sigprocmask, sigaction and SA_RESTART are available,
ruby always sets it.
if that is the case, then shouldn’t it be impossible for system calls to fail
with EINTR? (see thread regarding solaris/flock for history)
I’m wondering too. I see this not only in Ara’s test code, but in my
own, with heavy demand by threads and processes doing shared reads and
exclusive writes. After getting all(?) my concurrency bugs out, I still
had to put in a few “rescue Errno::EINTR; retry” statements, or else
there would be some (very infrequent) failures. Interestingly, it only
seems to happen during the shared reads, so it looks like something one
thread is doing causes a system call in another thread to be interrupted.
Again, this is solaris only. Linux is fine.
···
On Thu, 30 Jan 2003 nobu.nokada@softhome.net wrote:
At Thu, 30 Jan 2003 02:07:00 +0900, >>ahoward wrote:
In Solaris, it apparently needs to handle EINTR at every I/O
operations. Also fseek()?
i think this is actually the case for any system call on solaris - they
are not automatically restarted as in linux by default. i’ve posted to
comp.lang.unix.programmer regarding this, but i seem to find more knowledge on
this list…
-a
···
On Fri, 31 Jan 2003 nobu.nokada@softhome.net wrote:
Index: file.c
RCS file: /cvs/ruby/src/ruby/file.c,v
retrieving revision 1.130
diff -u -2 -p -r1.130 file.c
— file.c 29 Jan 2003 23:28:47 -0000 1.130
+++ file.c 30 Jan 2003 22:21:47 -0000
@@ -1990,4 +1990,5 @@ rb_file_flock(obj, operation)
fflush(GetWriteFile(fptr));
}
- retry:
TRAP_BEG;
ret = flock(fileno(fptr->f), NUM2INT(operation));
@@ -2001,4 +2002,9 @@ rb_file_flock(obj, operation)
#endif
return Qfalse;
- case EINTR:
+#if defined(ERESTART)
- case ERESTART:
+#endif
-
goto retry;
}
rb_sys_fail(fptr->path);
–
====================================
Ara Howard
NOAA Forecast Systems Laboratory
Information and Technology Services
Data Systems Group
R/FST 325 Broadway
Boulder, CO 80305-3328
Email: ahoward@fsl.noaa.gov
Phone: 303-497-7238
Fax: 303-497-7259
====================================