TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Peter Schuller
from: Erik Huelsmann
date: 1997-02-11 08:53:44
subject: Multiple threads accessing the same files

Replying to a message of Peter Schuller to Peter Fitzsimmons:

 PS>>> Hmmm, what's this client/servet thing? Could you 
 PS>>> explain? File locking I know

 >> In this context -- the client code (which does no file i/o) would send
 >> a  message to the server, like "read next message",  or
"write
 >> message". The  server,  being a separate process (perhaps on a
 >> different PC) would process  these messages from all clients.  Since
 >> the server is the only process that  has any message files open,  it
 >> need not use any locking at all.  This is  _very_ efficient across a
 >> network, when file locking is the other  alternative.

 PS> This seems to be the best way to do this. But there is only ONE
 PS> problem, how  do the server send the info to the client? One way
 PS> would be a pipe, but then  I'd need a separate queue for
 PS> error-mesages etc. With this C/S thing I only  have two problems:

 PS> 1) As above, how do the server send the extracted data (if any) to the
 PS> client  efficiently?

 PS> 2) When a lot of data is to be processed, what do I do? Let's say a
 PS> user scans  the file-base for new files, then the entire file-base
 PS> would have to be sent  to the client. Or should I let the server take
 PS> care of the searching? The only  problem then is that other clients
 PS> will have to w8, and I can't launch another  thread, be cause then
 PS> I'd have the access problem again upon other clients  wanting to
 PS> write data. One way would be to queue the search so that the server 
 PS> only "search" for 0.5 seconds at a time, and then work on other
 PS> clients, then  resume the searching for 0.5 secs, and so on... You've
 PS> got any ideas? I'm  getting close now :-)

This awfully looks like multitasking! Maybe you can start up an extra
thread for searching, so that the server can wait for its next client
command?

 PS> Thank you VERY much!

 PS> / Peter Schuller   [TeamOS/2]   petersch{at}kuai.se


 PS> -!- AdeptXBBS v1.08a26 (VC) (Registered)
 PS>  ! Origin: Gamma Epsilon 24h/day +46-(0)18-367781 (2:206/139)

Bye, Erik!
PGPkey available by e-mail/netmail

 *** I am slowly getting there, but Sibyl is getting me there faster :-)
 *** (Sibyl=a devellopment-tool) Q's? e-mail me at ErikH{at}hcc-gron.idn.nl

---
* Origin: ORIGINal (2:500/19.1929)
SEEN-BY: 50/99 54/99 270/101 620/243 625/160 711/401 413 430 934 712/311 407
SEEN-BY: 712/505 506 517 623 624 704 713/317 800/1
@PATH: 500/19 9 3 396/1 270/101 712/624 711/934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.