kayws426 / embox

Automatically exported from code.google.com/p/embox
0 stars 1 forks source link

io_sync enhancement #616

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What new or enhanced feature are you proposing?
Socket has own manual event named socket_not_empty to provide waits on empty 
socket. I sugget drop of ad-hoc socket_manual event and improve io_sync that 
already used in pipe and socket prior it could replace manual_event 

What goals would this enhancement help you to achieve?
Fix src/compat/posix/socket.c:socket that call for ksocket and fills 
sock->desc_data after. Note that some of kernel code could use desc_data before 
initilized.

How are you going to implement the enhancement?

Original issue reported on code.google.com by drakon.m...@gmail.com on 8 Jul 2013 at 11:43

GoogleCodeExporter commented 9 years ago
i suggest don't touch manual_event and make new realization of io_sync based on 
it.

Original comment by ki.stfu on 8 Jul 2013 at 11:47

GoogleCodeExporter commented 9 years ago
i suggest that such an implementation:

 15 struct io_sync {
 16     struct manual_event reading;    
 17     struct manual_event writing;    
 18 };  
 19     
 20 enum io_sync_op {
 21     IO_SYNC_READING = 1,
 22     IO_SYNC_WRITING = 2
 23 };  
 24     
 25 extern void io_sync_init(struct io_sync *io);
 26 extern void io_sync_enable(struct io_sync *io, enum io_sync_op op);
 27 extern void io_sync_disable(struct io_sync *io, enum io_sync_op op);
 28 extern int io_sync_wait(struct io_sync *io, enum io_sync_op op,
 29         unsigned long timeout);

Original comment by ki.stfu on 8 Jul 2013 at 1:58

GoogleCodeExporter commented 9 years ago

Original comment by ki.stfu on 16 Jul 2013 at 10:53