Welcome, Guest. Please login or register.

Author Topic: How does the filesystem handles multiple packets ?  (Read 1996 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show only replies by Jose
How does the filesystem handles multiple packets ?
« on: March 21, 2006, 05:02:50 PM »
Does it for example save two files at the same time, asynchronously, to the same HD ? I'm asking this cause I already have a separate process receiving messages to handle and save stuff to the HD, so if the answer is no probably it's not worth it to send multiples packets and  I'll just save one thing at a time.

:pint:
\\"We made Amiga, they {bleep}ed it up\\"
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: How does the filesystem handles multiple packets ?
« Reply #1 on: March 21, 2006, 05:20:21 PM »
Packets are processed in sequence. So yes, you can save any number of files simultanously.

However, depending on the filesystem, doing multiple (smallish) writes might result in massive seeking between the physical write locations. With such filesystems it is faster to actually write files in sequence.

Smarter filesystems such as PFS cache the writes in a way multiple writes don't slow the overall performance.

For best overall results you should do your own caching: that is collect the smaller writes to a larger buffer, and only ACTION_WRITE the buffer when it gets full. Buffer size should probably be at least 4K, but even upto 32K or 64K can still improve performance. This is with tons of small writes and large result files.
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: How does the filesystem handles multiple packets ?
« Reply #2 on: March 21, 2006, 05:23:09 PM »
- dupe zapped -
 

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show only replies by Jose
Re: How does the filesystem handles multiple packets ?
« Reply #3 on: March 21, 2006, 08:04:52 PM »
Aha! Thanks Piru.
\\"We made Amiga, they {bleep}ed it up\\"