[MLton-commit] r6449
spoons at mlton.org
spoons at mlton.org
Mon Mar 3 07:34:38 PST 2008
Mark (but don't fix) uses of global state in basis implementation.
These comments mark parts of the native basis implementation
that should be fixed for (any) parallel implementation of MLton.
----------------------------------------------------------------------
U mlton/branches/shared-heap-multicore/runtime/basis/MLton/Rlimit/rlimit.c
U mlton/branches/shared-heap-multicore/runtime/basis/MLton/Rusage/rusage.c
U mlton/branches/shared-heap-multicore/runtime/basis/Net/NetHostDB.c
U mlton/branches/shared-heap-multicore/runtime/basis/Net/NetProtDB.c
U mlton/branches/shared-heap-multicore/runtime/basis/Net/NetServDB.c
U mlton/branches/shared-heap-multicore/runtime/basis/Net/Socket/INetSock.c
U mlton/branches/shared-heap-multicore/runtime/basis/Net/Socket/select.c
U mlton/branches/shared-heap-multicore/runtime/basis/Posix/FileSys/Stat.c
U mlton/branches/shared-heap-multicore/runtime/basis/Posix/FileSys/Utimbuf.c
U mlton/branches/shared-heap-multicore/runtime/basis/Posix/IO/FLock.c
U mlton/branches/shared-heap-multicore/runtime/basis/Posix/ProcEnv/Times.c
U mlton/branches/shared-heap-multicore/runtime/basis/Posix/ProcEnv/Uname.c
U mlton/branches/shared-heap-multicore/runtime/basis/Posix/Signal.c
U mlton/branches/shared-heap-multicore/runtime/basis/Posix/SysDB/Group.c
U mlton/branches/shared-heap-multicore/runtime/basis/Posix/SysDB/Passwd.c
U mlton/branches/shared-heap-multicore/runtime/basis/Posix/TTY.c
U mlton/branches/shared-heap-multicore/runtime/basis/System/Date.c
U mlton/branches/shared-heap-multicore/runtime/basis/System/Time.c
----------------------------------------------------------------------
Modified: mlton/branches/shared-heap-multicore/runtime/basis/MLton/Rlimit/rlimit.c
===================================================================
--- mlton/branches/shared-heap-multicore/runtime/basis/MLton/Rlimit/rlimit.c 2008-03-03 15:33:02 UTC (rev 6448)
+++ mlton/branches/shared-heap-multicore/runtime/basis/MLton/Rlimit/rlimit.c 2008-03-03 15:34:36 UTC (rev 6449)
@@ -1,5 +1,6 @@
#include "platform.h"
+/* XXX global state */
static struct rlimit rlimit;
C_Errno_t(C_Int_t) MLton_Rlimit_get (C_Int_t r) {
Modified: mlton/branches/shared-heap-multicore/runtime/basis/MLton/Rusage/rusage.c
===================================================================
--- mlton/branches/shared-heap-multicore/runtime/basis/MLton/Rusage/rusage.c 2008-03-03 15:33:02 UTC (rev 6448)
+++ mlton/branches/shared-heap-multicore/runtime/basis/MLton/Rusage/rusage.c 2008-03-03 15:34:36 UTC (rev 6449)
@@ -1,7 +1,9 @@
#include "platform.h"
-extern struct GC_state gcState;
+/* XXX reference to global gcState */
+/* extern struct GC_state gcState; */
+/* XXX global state */
static struct rusage self;
static struct rusage children;
static struct rusage gc;
@@ -55,7 +57,10 @@
}
void MLton_Rusage_getrusage (void) {
+ /*
gc = *(GC_getRusageGCAddr (&gcState));
+ */
+ fprintf (stderr, "WARNING: some rusage statistics disabled\n");
getrusage (RUSAGE_SELF, &self);
getrusage (RUSAGE_CHILDREN, &children);
}
Modified: mlton/branches/shared-heap-multicore/runtime/basis/Net/NetHostDB.c
===================================================================
--- mlton/branches/shared-heap-multicore/runtime/basis/Net/NetHostDB.c 2008-03-03 15:33:02 UTC (rev 6448)
+++ mlton/branches/shared-heap-multicore/runtime/basis/Net/NetHostDB.c 2008-03-03 15:34:36 UTC (rev 6449)
@@ -1,5 +1,6 @@
#include "platform.h"
+/* XXX global state */
static struct hostent *hostent;
C_String_t NetHostDB_getEntryName(void) {
Modified: mlton/branches/shared-heap-multicore/runtime/basis/Net/NetProtDB.c
===================================================================
--- mlton/branches/shared-heap-multicore/runtime/basis/Net/NetProtDB.c 2008-03-03 15:33:02 UTC (rev 6448)
+++ mlton/branches/shared-heap-multicore/runtime/basis/Net/NetProtDB.c 2008-03-03 15:34:36 UTC (rev 6449)
@@ -1,5 +1,6 @@
#include "platform.h"
+/* XXX global state */
static struct protoent *protoent;
C_String_t NetProtDB_getEntryName(void) {
Modified: mlton/branches/shared-heap-multicore/runtime/basis/Net/NetServDB.c
===================================================================
--- mlton/branches/shared-heap-multicore/runtime/basis/Net/NetServDB.c 2008-03-03 15:33:02 UTC (rev 6448)
+++ mlton/branches/shared-heap-multicore/runtime/basis/Net/NetServDB.c 2008-03-03 15:34:36 UTC (rev 6449)
@@ -3,6 +3,7 @@
#include "platform.h"
+/* XXX global state */
static struct servent *servent;
C_String_t NetServDB_getEntryName(void) {
Modified: mlton/branches/shared-heap-multicore/runtime/basis/Net/Socket/INetSock.c
===================================================================
--- mlton/branches/shared-heap-multicore/runtime/basis/Net/Socket/INetSock.c 2008-03-03 15:33:02 UTC (rev 6448)
+++ mlton/branches/shared-heap-multicore/runtime/basis/Net/Socket/INetSock.c 2008-03-03 15:34:36 UTC (rev 6449)
@@ -11,6 +11,7 @@
*((socklen_t*)addrlen) = sizeof(struct sockaddr_in);
}
+/* XXX global state */
static uint16_t fromAddr_port;
static struct in_addr fromAddr_in_addr;
Modified: mlton/branches/shared-heap-multicore/runtime/basis/Net/Socket/select.c
===================================================================
--- mlton/branches/shared-heap-multicore/runtime/basis/Net/Socket/select.c 2008-03-03 15:33:02 UTC (rev 6448)
+++ mlton/branches/shared-heap-multicore/runtime/basis/Net/Socket/select.c 2008-03-03 15:34:36 UTC (rev 6449)
@@ -1,5 +1,6 @@
#include "platform.h"
+/* XXX global state */
static struct timeval timeout;
static struct timeval *timeoutPtr;
Modified: mlton/branches/shared-heap-multicore/runtime/basis/Posix/FileSys/Stat.c
===================================================================
--- mlton/branches/shared-heap-multicore/runtime/basis/Posix/FileSys/Stat.c 2008-03-03 15:33:02 UTC (rev 6448)
+++ mlton/branches/shared-heap-multicore/runtime/basis/Posix/FileSys/Stat.c 2008-03-03 15:34:36 UTC (rev 6449)
@@ -1,5 +1,6 @@
#include "platform.h"
+/* XXX global state */
static struct stat statbuf;
C_Dev_t Posix_FileSys_Stat_getDev (void) {
Modified: mlton/branches/shared-heap-multicore/runtime/basis/Posix/FileSys/Utimbuf.c
===================================================================
--- mlton/branches/shared-heap-multicore/runtime/basis/Posix/FileSys/Utimbuf.c 2008-03-03 15:33:02 UTC (rev 6448)
+++ mlton/branches/shared-heap-multicore/runtime/basis/Posix/FileSys/Utimbuf.c 2008-03-03 15:34:36 UTC (rev 6449)
@@ -1,5 +1,6 @@
#include "platform.h"
+/* XXX global state */
static struct utimbuf utimbuf;
void Posix_FileSys_Utimbuf_setAcTime (C_Time_t t) {
Modified: mlton/branches/shared-heap-multicore/runtime/basis/Posix/IO/FLock.c
===================================================================
--- mlton/branches/shared-heap-multicore/runtime/basis/Posix/IO/FLock.c 2008-03-03 15:33:02 UTC (rev 6448)
+++ mlton/branches/shared-heap-multicore/runtime/basis/Posix/IO/FLock.c 2008-03-03 15:34:36 UTC (rev 6449)
@@ -1,5 +1,6 @@
#include "platform.h"
+/* XXX global state */
static struct flock s_flock;
C_Errno_t(C_Int_t) Posix_IO_FLock_fcntl (C_Fd_t f, C_Int_t cmd) {
Modified: mlton/branches/shared-heap-multicore/runtime/basis/Posix/ProcEnv/Times.c
===================================================================
--- mlton/branches/shared-heap-multicore/runtime/basis/Posix/ProcEnv/Times.c 2008-03-03 15:33:02 UTC (rev 6448)
+++ mlton/branches/shared-heap-multicore/runtime/basis/Posix/ProcEnv/Times.c 2008-03-03 15:34:36 UTC (rev 6449)
@@ -1,5 +1,6 @@
#include "platform.h"
+/* XXX global state */
static struct tms tms;
C_Clock_t Posix_ProcEnv_Times_getUTime(void) {
Modified: mlton/branches/shared-heap-multicore/runtime/basis/Posix/ProcEnv/Uname.c
===================================================================
--- mlton/branches/shared-heap-multicore/runtime/basis/Posix/ProcEnv/Uname.c 2008-03-03 15:33:02 UTC (rev 6448)
+++ mlton/branches/shared-heap-multicore/runtime/basis/Posix/ProcEnv/Uname.c 2008-03-03 15:34:36 UTC (rev 6449)
@@ -1,5 +1,6 @@
#include "platform.h"
+/* XXX global state */
static struct utsname mlton_utsname;
C_String_t Posix_ProcEnv_Uname_getSysName (void) {
Modified: mlton/branches/shared-heap-multicore/runtime/basis/Posix/Signal.c
===================================================================
--- mlton/branches/shared-heap-multicore/runtime/basis/Posix/Signal.c 2008-03-03 15:33:02 UTC (rev 6448)
+++ mlton/branches/shared-heap-multicore/runtime/basis/Posix/Signal.c 2008-03-03 15:34:36 UTC (rev 6449)
@@ -1,5 +1,6 @@
#include "platform.h"
+/* XXX reference to global gcState */
extern struct GC_state gcState;
static void handler (int signum) {
@@ -55,6 +56,7 @@
}
C_Errno_t(C_Int_t) Posix_Signal_handlee (C_Int_t signum) {
+ /* XXX global state */
static struct sigaction sa;
sigaddset (GC_getSignalsHandledAddr (&gcState), signum);
@@ -85,6 +87,7 @@
GC_setGCSignalPending (&gcState, FALSE);
}
+/* XXX global state */
static sigset_t set;
C_Errno_t(C_Int_t) Posix_Signal_sigaddset (C_Signal_t signum) {
Modified: mlton/branches/shared-heap-multicore/runtime/basis/Posix/SysDB/Group.c
===================================================================
--- mlton/branches/shared-heap-multicore/runtime/basis/Posix/SysDB/Group.c 2008-03-03 15:33:02 UTC (rev 6448)
+++ mlton/branches/shared-heap-multicore/runtime/basis/Posix/SysDB/Group.c 2008-03-03 15:34:36 UTC (rev 6449)
@@ -1,5 +1,6 @@
#include "platform.h"
+/* XXX global state */
static struct group *group;
C_String_t Posix_SysDB_Group_getName(void) {
Modified: mlton/branches/shared-heap-multicore/runtime/basis/Posix/SysDB/Passwd.c
===================================================================
--- mlton/branches/shared-heap-multicore/runtime/basis/Posix/SysDB/Passwd.c 2008-03-03 15:33:02 UTC (rev 6448)
+++ mlton/branches/shared-heap-multicore/runtime/basis/Posix/SysDB/Passwd.c 2008-03-03 15:34:36 UTC (rev 6449)
@@ -1,5 +1,6 @@
#include "platform.h"
+/* XXX global state */
static struct passwd *passwd;
C_String_t Posix_SysDB_Passwd_getName(void) {
Modified: mlton/branches/shared-heap-multicore/runtime/basis/Posix/TTY.c
===================================================================
--- mlton/branches/shared-heap-multicore/runtime/basis/Posix/TTY.c 2008-03-03 15:33:02 UTC (rev 6448)
+++ mlton/branches/shared-heap-multicore/runtime/basis/Posix/TTY.c 2008-03-03 15:34:36 UTC (rev 6449)
@@ -1,5 +1,6 @@
#include "platform.h"
+/* XXX global state */
static struct termios termios;
C_TCFlag_t Posix_TTY_Termios_getIFlag (void) {
Modified: mlton/branches/shared-heap-multicore/runtime/basis/System/Date.c
===================================================================
--- mlton/branches/shared-heap-multicore/runtime/basis/System/Date.c 2008-03-03 15:33:02 UTC (rev 6448)
+++ mlton/branches/shared-heap-multicore/runtime/basis/System/Date.c 2008-03-03 15:34:36 UTC (rev 6449)
@@ -1,5 +1,6 @@
#include "platform.h"
+/* XXX global state */
static struct tm tm_in;
static struct tm *tm_out;
Modified: mlton/branches/shared-heap-multicore/runtime/basis/System/Time.c
===================================================================
--- mlton/branches/shared-heap-multicore/runtime/basis/System/Time.c 2008-03-03 15:33:02 UTC (rev 6448)
+++ mlton/branches/shared-heap-multicore/runtime/basis/System/Time.c 2008-03-03 15:34:36 UTC (rev 6449)
@@ -1,5 +1,6 @@
#include "platform.h"
+/* XXX global state */
static struct timeval timeval;
C_Int_t Time_getTimeOfDay (void) {
More information about the MLton-commit
mailing list