Is ICS safe for using in non-thread safe programs?

Yes of course.

i.e. is this scenario safe:
- single thread program writes to a disk file
- ICS is used to fetch something and written as buffer to the same disk file
and not corrupting previous wrte
- main thread is never interrupted by ICS events. i.e. ICS event does not
occur until some other event has finished.

Which component are you using ? I'll assume you use TWSocket. You - not the component - write data to disk. YOU are responsible for writing data at the right place into the file. If necessary you may use file locking.

in other words, my question is - is ICS async operation only async for
fetching data and not for events?

Sorry, I don't understand.

to expand the question - is any event, not just ICS something that can
interrupt program flow in a way to create additional thread to a single
threaded application?

ICS doesn't create thread of his own (At least not for writing data). An event never interrupt the main program, this is how WINDOWS work. Events are always triggered from the message pump. Events doesn't interrupt each other, unless you call the message pump from an event handler. Events are cooperative multitasking while multithreading is preemptive multitasking.

--
francois.pie...@overbyte.be
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to