This module for creating and working with individual threads in the local memory of each.
Project description
Introduction
flowgo
is a module for creating and working with individual threads in the local memory of each.
When threads are created, the system allocates an array of dtype values for thread local storage (TLS), which are initialized to NULL values.
Before an index can be used, one of the threads must be assigned. Each thread stores its index data in an array of TLS slots.
If the data associated with the index matches a value of type dtype , you can store the data directly in the TLS slot.
Installation
pip install flowgo
Import
from flowgo import new
#User Example
>>>from flowgo import new
>>> d = new(float,10)
>>> d.index
[[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]]
>>>import random
>>>class neuron:
def key(self):
self.f = random.random()
return self.f
>>> g = neuron()
>>> g
<__main__.neuron object at 0x000001E4183EE3D0>
>>>for y in range(0,10,1):
d.index[y] = neuron()
print(d.index[y])
<__main__.neuron object at 0x000001E4183C4D90>
<__main__.neuron object at 0x000001E4183C4DF0>
<__main__.neuron object at 0x000001E4183C4FA0>
<__main__.neuron object at 0x000001E4183C4D60>
<__main__.neuron object at 0x000001E4183C4E50>
<__main__.neuron object at 0x000001E4183C4F10>
<__main__.neuron object at 0x000001E4183C4FD0>
<__main__.neuron object at 0x000001E4183EE100>
<__main__.neuron object at 0x000001E4183EE160>
<__main__.neuron object at 0x000001E4183EE1C0>
>>> for y in range(0,10,1):
d.index[y] = g.key()
print(d.index[y])
0.44911829971109984
0.799771054321658
0.9866593046500528
0.5261054909048434
0.584669797754662
0.45202100815352386
0.9676910835103338
0.8198882778445146
0.7652557520179178
0.043740125797619434
>>> d.index
[0.44911829971109984, 0.799771054321658, 0.9866593046500528, 0.5261054909048434,
0.584669797754662, 0.11103911368026942, 0.9732179960637262, 0.45910841138678904,
0.4323464306091388, 0.017103767583308005]
>>> for y in range(3,10,1):
d.index[y] = neuron().key()
print(d.index[y])
0.736735454198254
0.5561266578913844
0.14408739831419615
0.6957408632107883
0.04113475552348311
0.1883360140198398
0.3012576585293536
>>> d.index.insert(5,neuron())
>>> d.index
[[0.0], [0.0], [0.0], 0.736735454198254, 0.5561266578913844, <__main__.neuron object at 0x000001E411A9E8E0>,
0.14408739831419615, 0.6957408632107883, 0.04113475552348311, 0.1883360140198398, 0.3012576585293536]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file flowgo-1.1.tar.gz
.
File metadata
- Download URL: flowgo-1.1.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b14846fe4882b3f42d4980ed1109e9a9902e2b92cdd332936216053236a978b |
|
MD5 | b3b460b03b23f795394235303744562f |
|
BLAKE2b-256 | 2fe2fd68d802feee695176b3f7b62f37e7c8da8f0b84c8675a2bb37ffb218a43 |
File details
Details for the file flowgo-1.1-py3-none-any.whl
.
File metadata
- Download URL: flowgo-1.1-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2da799fb40143faf4245e4df68d4075f0bcecdcc14f29e1eab38da3a56126809 |
|
MD5 | 825e6eafdd60bc641a7742f28d48d80d |
|
BLAKE2b-256 | e000ffd542c289f450fdbfd9fbf19d40970dbb6e1a4ec4f994f098ebbabe8cee |