I ´ll work on SVN directories so maybe it ´ll be off-line a few hours. You should make an update on SVN.
Saludos
Matias E. Vara
www.torokernel.org
Monday, November 08, 2010
Thursday, October 28, 2010
BugCon Presentation
Here it is the link to Toro´s presentation on BugCon2010. Enjoy!
Saludos.
PD: The presentation is in english. Thanks Eugene!
Matias E. Vara
www.torokernel.org
Saludos.
PD: The presentation is in english. Thanks Eugene!
Matias E. Vara
www.torokernel.org
Etiquetas:
bugcon,
Presentation
Sunday, September 19, 2010
Threads migration without Lock in Toro
In a Multicore environment, the programmer needs to create local and remote threads. In TORO create a remote threads is easy, you just have to use BeginThread() with the appropriate CPU identification. On that basis, there are two important procedures in TORO:
- Thread Emigrating: is when the threads are created in a remote processor.
- Thread Inmigrating: is when the guest processor enque in its scheduler the threads that they are comming from others processors.
This is the unique kernel point which needs syncronization between the cores. The mechanism is called "Exchange Slot" and it works without any atomic operation. In this case it used for send and receiv threads but it works with any kind of data.
For every processor in TORO there is an structure called TSchedulerExchangeSlot:
TSchedulerExchangeSlot = record - Thread Emigrating: is when the threads are created in a remote processor.
- Thread Inmigrating: is when the guest processor enque in its scheduler the threads that they are comming from others processors.
This is the unique kernel point which needs syncronization between the cores. The mechanism is called "Exchange Slot" and it works without any atomic operation. In this case it used for send and receiv threads but it works with any kind of data.
For every processor in TORO there is an structure called TSchedulerExchangeSlot:
DispatcherArray: array[0..MAX_CPU-1] of PThread;
EmigrateArray: array[0..MAX_CPU-1] of PThread;
end;
Where MAX_CPU is the number of processors and PThread is a pointer to TThread structure. From the structure declaration we can see that every processor has two arrays
(DispatcherArray y EmigrateArray), and every entry in the array is a pointer to a thread´s queu.
The procedure to send threads to remote processor has three stages:
1-The user calls to BeginThread()for create a new one, if the parameter CPUID is different to local CPU then the kernel enque it to DispatcherArray[CPUID].
2-During Scheduling (cause SysThreadSwitch syscall). The procedure Emigrating()moves all threads from DispatcherArray[] to EmigrateArray[] (only if EmigrateArray[] is nil)
3-During Scheduling of the Remote CPU, the procedure Inmigrating() look for a not nil entry in EmigrateArray[LocalCPUID] in every TSchedulerExchangeSlot processor structure. If it is not nil Then import all the threads to local scheduler and become EmigrateArray[LocalCpuid] to nil.
Local processor just writes and read to DispatcherArray[]. While the local and remote processor write and read to EmigrateArray[], but the access is synchronized using nil pointer.
The “Exchange Slot” doesn´t need "LOCK" instruction.
The Inmigrating and Emigrating procedures are called from the Scheduler. The scheduler makes a few system task, for example in the picture, we can see the scheduler´s flow diagram. There, first it calls Inmigrating(), after that it calls Emigrating() and At the end a new thread is scheduling.
Matias E. Vara
www.torokernel.org
The procedure to send threads to remote processor has three stages:
1-The user calls to BeginThread()for create a new one, if the parameter CPUID is different to local CPU then the kernel enque it to DispatcherArray[CPUID].
2-During Scheduling (cause SysThreadSwitch syscall). The procedure Emigrating()moves all threads from DispatcherArray[] to EmigrateArray[] (only if EmigrateArray[] is nil)
3-During Scheduling of the Remote CPU, the procedure Inmigrating() look for a not nil entry in EmigrateArray[LocalCPUID] in every TSchedulerExchangeSlot processor structure. If it is not nil Then import all the threads to local scheduler and become EmigrateArray[LocalCpuid] to nil.
Local processor just writes and read to DispatcherArray[]. While the local and remote processor write and read to EmigrateArray[], but the access is synchronized using nil pointer.
The “Exchange Slot” doesn´t need "LOCK" instruction.
Matias E. Vara
www.torokernel.org
Etiquetas:
atomic operations,
freepascal,
kernel,
locks,
multiprocessing,
pascal,
threads,
toro
Thursday, July 22, 2010
Toro in BugCon 2010!
I 'll be present in BugCon 2010 meeting, Mexico DF. I 'll talk about the problems of Modern Systems on Multicore environment and How Toro fixes them . Also I 'll compile and test toro step by step using Eclipse and QEMU. You can see others speakers here.
Saludos.
Matias E. Vara
www.torokernel.org
Saludos.
Matias E. Vara
www.torokernel.org
Subscribe to:
Posts (Atom)