[commtech] Fixes in gomp_stream
* Stick to the sizes used in gomp_stream * Release data when they are *all* received
This commit is contained in:
parent
d8c16a4aa3
commit
467d0b4122
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue