bitkeeper revision 1.1159.25.1 (411b92dbFatpuCFS9px_DggrIbxQsg)

Extra barriers in async shared-memory comms code.
This commit is contained in:
kaf24@scramble.cl.cam.ac.uk committed 2004-08-12 15:55:07 +00:00
1 parent e580b22f65
commit 4037eca6ae
7 files changed
+89 -49

No files matched your search

+15
View File
@@ -49,6 +49,13 @@
/* Size of a machine page frame. */
#define PAGE_SIZE 4096
#if defined(__i386__)
#define rmb() __asm__ __volatile__ ( "lock; addl $0,0(%%esp)" : : : "memory" )
#define wmb() __asm__ __volatile__ ( "" : : : "memory" )
#else
#error "Define barriers"
#endif
/*
* *********************** NOTIFIER ***********************
@@ -710,6 +717,9 @@ static PyObject *xu_port_read_request(PyObject *self, PyObject *args)
return NULL;
}
/* Need to ensure we see the request, despite seeing the index update.*/
rmb();
cmsg = &cif->tx_ring[MASK_CONTROL_IDX(c)];
xum = PyObject_New(xu_message_object, &xu_message_type);
memcpy(&xum->msg, cmsg, sizeof(*cmsg));
@@ -745,6 +755,7 @@ static PyObject *xu_port_write_request(PyObject *self, PyObject *args)
cmsg = &cif->rx_ring[MASK_CONTROL_IDX(p)];
memcpy(cmsg, &xum->msg, sizeof(*cmsg));
wmb();
xup->rx_req_prod = cif->rx_req_prod = p + 1;
Py_INCREF(Py_None);
@@ -768,6 +779,9 @@ static PyObject *xu_port_read_response(PyObject *self, PyObject *args)
return NULL;
}
/* Need to ensure we see the response, despite seeing the index update.*/
rmb();
cmsg = &cif->rx_ring[MASK_CONTROL_IDX(c)];
xum = PyObject_New(xu_message_object, &xu_message_type);
memcpy(&xum->msg, cmsg, sizeof(*cmsg));
@@ -803,6 +817,7 @@ static PyObject *xu_port_write_response(PyObject *self, PyObject *args)
cmsg = &cif->tx_ring[MASK_CONTROL_IDX(p)];
memcpy(cmsg, &xum->msg, sizeof(*cmsg));
wmb();
xup->tx_resp_prod = cif->tx_resp_prod = p + 1;
Py_INCREF(Py_None);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.