From 467d0b4122fb374ab4910544ce21d2496d0da501 Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Sat, 7 Jul 2012 23:26:24 +0200 Subject: [PATCH] [commtech] Fixes in gomp_stream * Stick to the sizes used in gomp_stream * Release data when they are *all* received --- communication_techniques/src/communication/gomp_stream.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/communication_techniques/src/communication/gomp_stream.c b/communication_techniques/src/communication/gomp_stream.c index bdef6d2..0ef9a12 100644 --- a/communication_techniques/src/communication/gomp_stream.c +++ b/communication_techniques/src/communication/gomp_stream.c @@ -934,13 +934,13 @@ void *create_comm_channel(void) goto create_task_error; // BURST_SIZE = 128 ou 1024 - rview = GOMP_stream_create_read_view(BURST_SIZE + CACHE_LINE_SIZE, + rview = GOMP_stream_create_read_view(BURST_SIZE, BURST_SIZE); if (rview == NULL) goto create_rview_error; GOMP_stream_connect_view(task, stream, rview); - wview = GOMP_stream_create_write_view(BURST_SIZE + CACHE_LINE_SIZE, + wview = GOMP_stream_create_write_view(BURST_SIZE, BURST_SIZE); if (wview == NULL) goto create_wview_error; @@ -1020,6 +1020,7 @@ ssize_t recv_some_data(struct channel *channel, void **buf, size_t count) nb_read = (nb_read > count) ? count : nb_read; for (i = 0; i < nb_read; i++) buf[i] = *channel->read_ptr++; - GOMP_stream_release(channel->rview, channel->read_act); + if (channel->read_ptr == channel->read_end_ptr) + GOMP_stream_release(channel->rview, channel->read_act); return nb_read; }