sajioo
پنج شنبه 29 آبان 1393, 07:59 صبح
سلام دوستان کریتیکال سکشن چیست و اگه میشه چند نمونه مثال و کد برای بنده بگید تا بیشتر آشنا بشم.
برای مثال من از indytcpserver استفاده میکنم. و باید در هر بار Executeکردن از آرایه سراسری ip استفاده کنم و با حلقه اون آرایه رو پیمایش کنم . چطور میتونم از کریتیکال سکشن استفاده کنم و کاربرد آن برای من چیست؟
متنی که در ویکی پدیا پیدا کردم
In concurrent programming (http://en.wikipedia.org/wiki/Concurrent_programming), a critical section is a piece of code (http://en.wikipedia.org/wiki/Code) that accesses a shared resource (data structure or device) that must not be concurrently accessed by more than one thread of execution (http://en.wikipedia.org/wiki/Thread_(computer_science)).[1] (http://en.wikipedia.org/wiki/Critical_section#cite_note-1) A critical section will usually terminate in fixed time, and a thread, task, or process will have to wait for a fixed time to enter it (aka bounded waiting). Some synchronization (http://en.wikipedia.org/wiki/Synchronization_(computer_science)) mechanism is required at the entry and exit of the critical section to ensure exclusive use, for example a semaphore (http://en.wikipedia.org/wiki/Semaphore_(programming)).
عنوان تایپیک اشتباست .ادمین عزیز تغییرش بده لطفا
برای مثال من از indytcpserver استفاده میکنم. و باید در هر بار Executeکردن از آرایه سراسری ip استفاده کنم و با حلقه اون آرایه رو پیمایش کنم . چطور میتونم از کریتیکال سکشن استفاده کنم و کاربرد آن برای من چیست؟
متنی که در ویکی پدیا پیدا کردم
In concurrent programming (http://en.wikipedia.org/wiki/Concurrent_programming), a critical section is a piece of code (http://en.wikipedia.org/wiki/Code) that accesses a shared resource (data structure or device) that must not be concurrently accessed by more than one thread of execution (http://en.wikipedia.org/wiki/Thread_(computer_science)).[1] (http://en.wikipedia.org/wiki/Critical_section#cite_note-1) A critical section will usually terminate in fixed time, and a thread, task, or process will have to wait for a fixed time to enter it (aka bounded waiting). Some synchronization (http://en.wikipedia.org/wiki/Synchronization_(computer_science)) mechanism is required at the entry and exit of the critical section to ensure exclusive use, for example a semaphore (http://en.wikipedia.org/wiki/Semaphore_(programming)).
عنوان تایپیک اشتباست .ادمین عزیز تغییرش بده لطفا