(I started researching and using C# 2 days ago, so sorry if some of this is basic)
After much reading and other research I have the following concerns:
1) I need a large number of 64K buffers (as many as I can get) and they will last the life of the app.
2) These will be read/written to/from via win API's
3) They need to accessed via pointers (kept in a circular list)
4) I understand I can allocate them on the heap by using the "fixed" keyword and they will not be moved..
5) I also understand I can get and use pointers to them if I use "unsafe" code blocks. Outside of the need for careful code, is there any other problems that "unsafe" causes?
6) I also understand that these fixed buffers will not be managed by the garbage cleanup (the pointer will remain valid).
7) Is there any problems using a large amount of fixed heap? (I expect this will limit the amount of cleanup that can be done) How much heap does .net need to function etc?
8) using pinvoke, can i use these pointers the same way as I would of in c/c++ and avoid marshalling?
9) the win API functions use PVOID to both read and write data.
10) It seems that marshalling is often about allowing the operation and then copying the data to managed code.
11) I need to avoid any memory copying both to avoid time loss and duplicate memory.
12) the app will be moving many 100's of megabytes per second, so want to avoid hidden overheads.
Any help/comments you can provide on this would help. (The books I have don't seem to think I need to know this detail!)
Thanks,
Larry
After much reading and other research I have the following concerns:
1) I need a large number of 64K buffers (as many as I can get) and they will last the life of the app.
2) These will be read/written to/from via win API's
3) They need to accessed via pointers (kept in a circular list)
4) I understand I can allocate them on the heap by using the "fixed" keyword and they will not be moved..
5) I also understand I can get and use pointers to them if I use "unsafe" code blocks. Outside of the need for careful code, is there any other problems that "unsafe" causes?
6) I also understand that these fixed buffers will not be managed by the garbage cleanup (the pointer will remain valid).
7) Is there any problems using a large amount of fixed heap? (I expect this will limit the amount of cleanup that can be done) How much heap does .net need to function etc?
8) using pinvoke, can i use these pointers the same way as I would of in c/c++ and avoid marshalling?
9) the win API functions use PVOID to both read and write data.
10) It seems that marshalling is often about allowing the operation and then copying the data to managed code.
11) I need to avoid any memory copying both to avoid time loss and duplicate memory.
12) the app will be moving many 100's of megabytes per second, so want to avoid hidden overheads.
Any help/comments you can provide on this would help. (The books I have don't seem to think I need to know this detail!)
Thanks,
Larry